M
M
MadDog13372021-05-26 12:53:55
Unity
MadDog1337, 2021-05-26 12:53:55

How to make a store in Unity?

I want to make a store in the game, but in fact I did not find a single worthwhile guide or article (as I specifically need). I want to do the following: there is the game itself, there is a separate store scene, when buying in the store, the object must appear in another, main scene of the game and also execute the code below*. In the future, it is necessary that the same object can be bought another N number of times, and the entire code from below * also multiplies.

IEnumerator Farm()
    {
        yield return new WaitForSeconds(1.5f);
        Coins = Coins + 0.0001f;
        StartCoroutine(Farm());
        Debug.Log(Coins);
        PlayerPrefs.SetFloat("Coins", Coins);
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MoRpo, 2021-05-26
@MoRpo

Let me explain, look there is such a system called cache. It remembers all your actions that you want to save, for example, if you take a skin and you want it to be with you in other scenes, then you need to write a script into the product that saves information, and the player’s script will have to pick it up!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question