Okay, I watched now this tutorial: https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-button
And made it that way with that script:
using UnityEngine;
using System.Collections;
public class Help : MonoBehaviour {
public GameObject startHelpText;
void Start() {
startHelpText.SetActive(false);
}
public void switchHelp(GameObject helpText) {
if(helpText.activeSelf) {
helpText.SetActive(false);
}
else {
helpText.SetActive(true);
}
}
}
I put that Script on an empty object and put that object on the "On Click ()" thing in the button and choose the "switchHelp(GameObject helpText) " in there. It's working now... but I thought it could be easier...
↧