void enemyDie() { if (_gameManager.gameState == GameState.Play) { if (_Hp <= 0) { planeDie.Explosion(); _gameManager.addPoint(_Point); _gameManager.countEnemyDie++; Destroy(gameObject); } } }
void enemyDie() { if (_gameManager.gameState == GameState.Play) { if (_Hp <= 0) { planeDie.Explosion(); _gameManager.addPoint(_Point); _gameManager.countEnemyDie++; if (Random.Range(0, 1000) < GameSetting.instance.SupportDropRate) { Instantiate(GameSetting.instance.supportPrefab); } Destroy(gameObject); } } }
void takeDame() { if (preHP <= 0) { planeDie.Explosion(); if (GameSetting.instance.getLife()) { StartCoroutine(revival()); Transform pointGen = GameObject.Find("pointGenPlayer").transform; transform.position = pointGen.position; _gameManager._uiManager.updateData(); } else if (_gameManager != null) { _gameManager.gameOver(); Destroy(gameObject); } } }