Example #1
0
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (_enemy == null)
     {
         _enemy = animator.GetComponent<Enemy>();
         _ardColl = animator.GetComponentInChildren<AttackRangeDetector>().GetComponent<Collider>();
     }
     _ardColl.enabled = false;
 }
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     WIHolder whtemp = animator.gameObject.GetComponentInParent<Character>().gameObject.GetComponentInChildren<WIHolder>();
     pos = whtemp.gameObject.transform.localPosition;
     rot = whtemp.gameObject.transform.localRotation;
     animator.GetComponent<IKHands>().ikActive = false;
     whtemp.gameObject.transform.SetParent(animator.GetComponentInChildren<RHandItPos>().gameObject.transform);
     whtemp.gameObject.transform.localPosition = Vector3.zero;
 }
	 // 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) 
    {
        animator.SetBool("CanAttack", false);
        animator.GetComponentInChildren<MeleeAttack>().GetComponent<CircleCollider2D>().enabled = true;
	}