void Start() { events = new List <GameObject> (); // Instantiates the default Fighter Controller. Gets activated with an Invoke method. eventPointer = fighterController; events.Add(eventPointer); // Instantiates the other controllers. Deactivates them, waiting for triggers to activate. eventPointer = asteroidController; events.Add(eventPointer); eventPointer = flagshipController; events.Add(eventPointer); eventPointer = rocketsController; events.Add(eventPointer); Invoke("firstEvent", firstEventStartTime); // Timer instantiation. timerScript = GameObject.Find("Timer").GetComponent <SurvivalTimerScript>(); if (timerScript == null) { Debug.LogError("Couldn't find Timerscript"); } //TODO: Allow PlayerPrefs options to instantiate other gameObjects controllers. Should have less hardcoded objects. }
void Awake() { playerScript = gameObject.GetComponent <PlayerScript> (); if (playerScript == null) { Debug.LogError("Aaron Says: No PlayerScript Instantiated in Cutscene Script!"); } thrusterScript = gameObject.GetComponentInChildren <ThrusterScript> (); if (thrusterScript == null) { Debug.LogError("Aaron Says: No ThrusterScript Instantiated in Cutscene Script!"); } timerScript = GameObject.Find("Timer").GetComponent <SurvivalTimerScript> (); if (timerScript == null) { Debug.LogError("Aaron Says: No ThrusterScript Instantiated in Cutscene Script!"); } AudioSource.PlayClipAtPoint(warpSFX, transform.position); }