Newbie question here. I have a shop scene in which I have a buy button. And a button and text counter in the Play scene. What should I do that when I press the buy button in the SHOP SCENE, it will increment the value to x1 of the button’s text else it will not be interactable?
Help me please.
Now it depends how you load the scene.
Using this way all the game scene gameobjects will be removed (except having DonntDestroyOnLoad). So you should better save this incremented value in PlayerPrefs and update it later, on loading game scene.
- Application.LoadLevelAdditive
Using this way you have access to the text of the game scene objects. You can access them directly may be using GameObject.FindGameObjectWithTag()
and Set the Text
component’s text.
You should better store it in PlayerPrefs
in both cases for use it on other scenes too (if there are).