C
C
Chipu2018-09-27 15:24:17
C++ / C#
Chipu, 2018-09-27 15:24:17

unity. How to not load some scene objects after restarting the game?

Let's say I have gold data stored in PlayerPrefs and there is also a button to improve the player's attack. When pressed, the player receives +5 damage and the button disappears. How can I make it so that after the restart it does not appear again?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2018-09-27
@GavriKos

The direct answer to your question is no.
And the simple answer is - after loading the scene, check and set the desired states of the objects. You can do it in Awake, for example.

A
Alex Maximovich, 2018-09-27
@flexer1992

Remember in the same PlayerPrefs the fact of pressing this button. And as mentioned above, on the button itself in Awake, check the contents of the saved data, if there was a click, then do gameObject.SetActive (false)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question