// Use this for initialization void Start() { StartCoroutine(GameLoop()); aC = FindObjectOfType <arrowControl>(); endManager = FindObjectOfType <EndOfLevel>(); }
void Start() { // targetAngle = this.transform.rotation; rGM = FindObjectOfType <GameManager>(); eOL = FindObjectOfType <EndOfLevel>(); boing = GetComponent <AudioSource> (); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { gameObject.SetActive(false); FindObjectOfType <AudioManager>().Play("PickUpEngine"); EndOfLevel.DisplayMenu(); } }
private void SingletonPattern() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
/// <summary> /// Virtual function for when the level is over. /// </summary> public virtual void OnEndOfLevel() { EndOfLevel?.Invoke(this, null); }
public EndOfLevel endOfLevel; // Holds reference to EndOfLevel script //bool levelEnded = false; void Start() { // Assigns the reference to the EndOfLevel endOfLevel = FindObjectOfType <EndOfLevel>(); //levelEnded = false; }