コード例 #1
0
    void OnTriggerEnter(Collider other)
    {
        //Zombie has entered the freeze zone
        if (other.gameObject.CompareTag("BasicZombie"))
        {
            ZombieController zc = other.gameObject.GetComponent <ZombieController> ();

            //The zombie is currently moving
            if (zc.CanMove())
            {
                //Make it stop
                zc.TriggerCanMove();
                //Add this zombie to this skills list of frozen zombies
                frozenZombies.Add(zc);
                SlideToSurviveAchievements.archerAchievement.ZombieFrozen();

                //make frozen zombie tomb in that spot
                GameObject frozenTomb = (GameObject)Instantiate(frozenZombieTombPrefab, other.gameObject.transform.position, Quaternion.identity);
                frozenZombieTombs.Add(frozenTomb);
            }
        }
    }