void Update() { GameObject Manager = GameObject.Find("GameManager"); O_GameManager gamemanager = Manager.GetComponent <O_GameManager>(); enemyCount = gamemanager.spawnCount; }
void OnTriggerEnter(Collider other) { GameObject Manager = GameObject.Find("GameManager"); O_GameManager gamemanager = Manager.GetComponent <O_GameManager>(); if (other.CompareTag("Player")) { DestroyProjectile(); O_GameManager.MinusLives(1); } }
void OnTriggerEnter(Collider other) { GameObject Manager = GameObject.Find("GameManager"); O_GameManager gamemanager = Manager.GetComponent <O_GameManager>(); if (other.gameObject.tag == "Enemy") { O_GameManager.AddPoints(killPoints); Destroy(other.gameObject); Destroy(this.gameObject); gamemanager.spawnCount--; } }
void Awake() { if (m_instance != null && m_instance != this) { Destroy(this.gameObject); return; } else { m_instance = this; } DontDestroyOnLoad(this.gameObject); }