Exemplo n.º 1
0
 /// <summary>
 /// Destroies the ship
 /// </summary>
 public override void Destroy()
 {
     CoinController.SpawnCoin(this.transform.position);
     EnemyController.RecycleEnemy(gameObject);
     GameManager.Instance.AddScore(10);
     GameManager.Instance.UpdateEnemiesKilled();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Spawn coin after ship destroied
        /// </summary>
        /// <param name="position"> Ship Position </param>
        public static void SpawnCoin(Vector3 position)
        {
            GameObject coin = CoinController.GetCoin();

            coin.SetActive(true);
            coin.transform.parent   = null;
            coin.transform.position = position;
            coin.GetComponent <Coin>().Init();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Put back to the object pool
 /// </summary>
 void Recycle()
 {
     CoinController.Recycle(gameObject);
 }