public static QuestionManager GetQuestionManager() { // tries to find question manager in the scene // if not, then create one and initialise it. GameObject questionManagerObject = GameObject.Find("QuestionManagerPrefab(Clone)"); if (questionManagerObject) { // return the existing one return(questionManagerObject.GetComponent <QuestionManager>()); } else { // create a new one questionManagerObject = Instantiate(Resources.Load("QuestionManagerPrefab")) as GameObject; QuestionManager questionManager = questionManagerObject.GetComponent <QuestionManager>(); DontDestroyOnLoad(questionManager.gameObject); // make it persist between scenes questionManager.LoadQuestions(); return(questionManager); } }
public void StartAnimation() { _audioManager = AudioManager.GetAudioManager(); _questionManager = QuestionManager.GetQuestionManager(); StartCoroutine(ZoomSequence()); }