// Use this for initialization
 void Start()
 {
     m_moving = GetComponent<MovingBehaviour>();
     m_phyChar = GetComponent<PhysicCharBehaviour>();
     m_pathFindingBehaviour = GetComponent<MapPathFindingBehaviour>();
     m_animCtrl = GetComponent<CharAnimationController>();
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     m_fAngOff = 360f * Random.value;
     m_player = GameObject.FindGameObjectWithTag("Player");
     m_moving = GetComponent<MovingBehaviour>();
     m_phyChar = GetComponent<PhysicCharBehaviour>();
     m_pathFindingBehaviour = GetComponent<MapPathFindingBehaviour>();
     m_animCtrl = GetComponent<CharAnimationController>();
 }
예제 #3
0
    public void TurnIntoZombie()
    {
        if (isZombie)
        {
            return;
        }

        isZombie = true;
        tag      = "Zombie";
        if (DiseaseEffect != null)
        {
            Destroy(DiseaseEffect);
        }

        HerbivoreBehaviour herbivore = GetComponent <HerbivoreBehaviour>();

        if (herbivore != null)
        {
            Destroy(herbivore);
        }
        age = GetComponent <AgingBehaviour>();
        if (age != null)
        {
            Destroy(age);
        }
        hunger = GetComponent <HungerBehaviour>();
        hunger.HungerDamage = 0;
        reproduce           = GetComponent <ReproductionBehaviour>();
        if (reproduce != null)
        {
            Destroy(reproduce);
        }

        locator    = GetComponent <LocatorBehaviour>();
        eating     = GetComponent <EatingBehaviour>();
        carnivores = GameObject.FindGameObjectWithTag("CarnivoreContainer").transform;

        move       = GetComponent <MovingBehaviour>();
        move.Speed = ZombieSpeed;
        move.Flee  = false;

        transform.parent = GameObject.FindGameObjectWithTag("ZombieContainer").transform;

        GetComponent <Animator>().runtimeAnimatorController = Resources.Load <RuntimeAnimatorController>("Animations/Zombie/ZombieSheet_0");
    }