Example #1
0
 protected virtual void Update()
 {
     if (attackAnimationTime >= 0)
     {
         attackAnimationTime += Time.deltaTime;
         if (NowCheckFrame == null)// 如果检测片段是空的不需要下次检测了
         {
             attackAnimationTime = -1;
         }
         if (NowCheckFrame != null && NowCheckFrame.endTime < attackAnimationTime)//如果超过判断时间则不需要检测了
         {
             NowCheckFrame       = null;
             attackAnimationTime = -1;
         }
     }
 }
Example #2
0
 /// <summary>
 /// 动画进入或离开某状态
 /// </summary>
 /// <param name="actionTag"></param>
 /// <param name="enter"></param>
 protected virtual void PlayerAnimEnterLeaveState_AnimEnterLeaveHandle(string actionTag, bool enter)
 {
     if (enter)
     {
         attackAnimationTime = 0;
         MonsterAttackStruct.MonsterAttackFrame tempMonsterAttackFrame = monsterAttackStruct.Search(actionTag);
         if (tempMonsterAttackFrame != null && tempMonsterAttackFrame != NowCheckFrame)
         {
             NowCheckFrame = tempMonsterAttackFrame;
         }
     }
     else
     {
         attackAnimationTime = -1;
         if (NowCheckFrame != null && NowCheckFrame.ActionAnimationTag == actionTag)
         {
             NowCheckFrame = null;
         }
     }
 }