예제 #1
0
    //
    public void DestroyMonster()
    {
        // Explosion animation
        GameObject explosion = Instantiate(ExplosionPrefab, new Vector3(0, 0.6f, 0), transform.rotation, monsterSpawner.transform);

        Destroy(explosion, 0.5f);

        // Destroys the monster
        Destroy(monster);

        // Spawns a new monster
        monster          = monsterSpawner.SpawnMob();
        monsterComponent = monster.GetComponent <Monster>();
    }