Exemple #1
0
 void Awake()
 {
     instance       = this;
     charController = GetComponent <CharController>();
     animator       = GetComponent <Animator>();
     source         = GetComponent <AudioSource>();
 }
Exemple #2
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        CatboyController cont = CatboyController.instance;

        if (tempFollowTarget != "")
        {
            cont.followOverride = GameObject.Find(tempFollowTarget).transform;
        }
        else
        {
            cont.followOverride = null;
        }
        if (startFollowPlayer)
        {
            cont.followingPlayer = true;
        }
        if (stopFollowPlayer)
        {
            cont.followingPlayer = false;
        }
    }