hey there,
I wanted to make an extra toggle in the options menu for turning the Display Indefinite setting in the Speech Manager off and on, but I'm having some trouble figuring out how to do that.
In MenuSystem.cs I put:
if (_menu.title == "Options") {
if (_element.title == "ContinueToggle") {
if (speechManager.displayForever == false)
speechManager.displayForever = true;
else
speechManager.displayForever = false;
}
}
But it throws a nullref exception on the speechManager.displayForever line. I instantiated the SpeechManager above like this:
static private SpeechManager speechManager; and on start: speechManager = GameObject.FindObjectOfType(typeof(SpeechManager)) as SpeechManager;
How do I bind the On and Off state of a toggle succesfully to a custom script?
Comments
AdvGame.GetReferences ().speechManager;
Incidentally, if you ever wanted to stop AC reverting to the Demo managers when upgrading, simply uncheck the import of the References asset!