//public bool startRoof; // 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) { enemy = animator.GetComponent <enemyController>(); if (enemy.startOnRoof == false) { enemy.SetGravity(1f); enemy.RunIdleWait(); enemy.RunFlipWait(); } else { enemy.SetGravity(-1f); } }
//public bool isFlyer; //this is a statemachine that is attached to the enraged animation - it now handles movement toward the player. // 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) { playerPos = GameObject.FindGameObjectWithTag("Player").transform; enemy = animator.GetComponent <enemyController>(); if (enemy.isFlyer == true) { enemy.SetGravity(0f); } }
// 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) { enemy = animator.GetComponent <enemyController>(); enemy.RunPatrolWait(); enemy.RunFlipWait(); if (enemy.isFlyer == true) { enemy.SetGravity(0f); } }
// 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) { enemy = animator.GetComponent <enemyController>(); enemy.SetGravity(0.5f); }
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { enemy.SetGravity(0f); }