Example #1
0
    private void Despawn()
    {
        Vector3 audioPos = transform.position;

        audioPos.z = -10;
        AudioSource.PlayClipAtPoint(GetComponent <AudioSource>().clip, audioPos);

        manager.inactiveEnemies.Add(gameObject);
        manager.activeEnemies.Remove(gameObject);
        manager.numEnemiesActive--;
        stats.isDead = false;
        stats.AddPoints();

        manager.UpdateCounter();

        gameObject.SetActive(false);
        GetComponent <CharacterStats>().ResetStats();
    }