public virtual void AttackTrigger(int triggerIndex) { if (animal) { animal.AttackTrigger(triggerIndex); } }
override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animal.IsAttacking = true; //Important Make Sure its stays true!! if (!isOn && (stateInfo.normalizedTime % 1) >= On) { animal.AttackTrigger(AttackTrigger); isOn = true; } if (!isOff && (stateInfo.normalizedTime % 1) >= Off) { animal.AttackTrigger(0); isOff = true; } if (attackDelay > 0) { if (Time.time - attacktime > attackDelay) { animal.IsAttacking = false; } } }