Exemple #1
0
    void Awake()
    {
        // Setting up the references.
        enemySight         = GetComponent <EnemyZombieSight>();
        nav                = GetComponent <UnityEngine.AI.NavMeshAgent>();
        player             = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        playerHealth       = player.GetComponent <DonePlayerHealth>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>();

        enemyZombieAttack = GetComponentInChildren <EnemyZombieAttack>();
    }
Exemple #2
0
    private DoneAnimatorSetup animSetup;                // An instance of the AnimatorSetup helper class.


    void Awake()
    {
        // Setting up the references.
        player     = GameObject.FindGameObjectWithTag(DoneTags.player).transform;
        enemySight = GetComponent <EnemyZombieSight>();
        nav        = GetComponent <UnityEngine.AI.NavMeshAgent>();
        anim       = GetComponent <Animator>();
        hash       = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>();

        // Making sure the rotation is controlled by Mecanim.
        // nav.updateRotation = false;

        // Creating an instance of the AnimatorSetup class and calling it's constructor.
        // animSetup = new DoneAnimatorSetup(anim, hash);

        // Set the weights for the shooting and gun layers to 1.
        //anim.SetLayerWeight(1, 1f);
        //anim.SetLayerWeight(2, 1f);

        // We need to convert the angle for the deadzone from degrees to radians.
        // deadZone *= Mathf.Deg2Rad;
    }