Hi! Can anyone help me?
My problem is:
For example in menu (scene 1) there are two buttons with levels of difficulty: “hard” and “easy”. If we press button “hard” object (in scene 2) must return to “true”. But if we press button “easy” nothing must not happen. I hope you can help me;) Thank you…, ![Hi! Can anyone help me?
My problem is:
For example in menu (scene 1) there are two buttons with levels of difficulty: “hard” and “easy”. If we press button “hard” object (in scene 2) must return to “true”. But if we press button “easy” nothing must not happen. I hope you can help me;) Thank you…][1]
(Bad English)
If that is a UI button then this is easy.
On your game script have public function like this:
public void ButDifficulty(bool which)
{
//do something with the value 'which'
//set your difficulty
//something like
//diffulty = which;
}
Now in the inspector find your button and the event trigger, there should be an option to drag and drop a gameobject into the event trigger. Then you can pull down the list of functions on the gameobject, select the function above. Finally in the inspector, for the “hard” type “true” and for the easy type “false”.
You just need to add object with “not destroy on load”. It will help you to change settings between scenes!