Hello there,
i am new to unity, so excuse me if i dont know exactly how to adress my problems…
I am building my first App with Unity right now. It’s some kind of a guided Meditation App.
Here is a scribble of the Main-Function-Screen:
So the Main-Function is: If you press somewhere on the screen (inside the red field), you will see the Next Meditation-Screen (so only the Text under the red field changes). Also, you will here an Audio-File, where someone is reading the Text. By pressing/touching the red field again, you will see the next Meditation-Screen and so on.
In the bottom left corner is a Back-Button, which will bring you back to the last Meditation-Screen.
Solving the “Switch to next Meditation-Screen” problem was “easy”. The Meditation-Screen (with the Text and the Audio) is a button. So i set the “GameObject.SetActive” in the on Click feature inside the Inspector for the pressed button to “not active” and for the next button to “active”
But for the Back-Button in the bottom left, i want to use a script.
I mean i could place a Back Button for every Meditation-Screen, but i would love to solve this with a script.
So the function of the Back-Button should change, depending on the Meditation-Screen, that is shown right now.
I never done Scripting before, i am totaly new to it. But i “guess”, it sould be something like this:
if (Res_02_Button = active)
onClick.BackButton.setActive.Res_02_Button = false
onClick.BackButton.setActive.Res_01_Button = true
else if (Res_03_Button = active)
onClick.BackButton.setActive.Res_03_Button = false
onClick.BackButton.setActive.Res_02_Button = true
I mean…this code is complete bullshit, but i hope you can understand my thoughts here.
Also, the challenge to descripe something you are new in, is even higher when its not your native language. So sorry for that
It would be nice if someone could help me with that code. If you can not understand what i mean, i can try to describe it in another way!
thanks in advance for any help!