public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     base.OnStateUpdate(animator, stateInfo, layerIndex);
     if (AttackTimes.Length > AttackIndex && stateInfo.normalizedTime > AttackTimes[AttackIndex])
     {
         AttackIndex++;
         BossBehaviour bossBehaviour = animator.transform.root.GetComponent <BossBehaviour>();
         if (bossBehaviour)
         {
             bossBehaviour.Attack();
         }
     }
 }