コード例 #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();
 }
コード例 #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();
        }
コード例 #3
0
 /// <summary>
 /// Put back to the object pool
 /// </summary>
 void Recycle()
 {
     CoinController.Recycle(gameObject);
 }