示例#1
0
    void EnemyDefeat()
    {
        AudioClip enemyDestroyedSound = gameObject.audio.clip;

        AudioSource.PlayClipAtPoint(enemyDestroyedSound, gameObject.transform.position, 0.3f);
        textAdd.ScoreAdding(scoreValue);
        Instantiate(explosion, gameObject.transform.position, Quaternion.identity);
        EnemySpawn enemyCunter;

        enemyCunter             = FindObjectOfType <EnemySpawn>();
        enemyCunter.enemyCount += 1;
        Destroy(gameObject);
    }