コード例 #1
0
 public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (this.mLocalMotion == null) return;
     if (this.mCallBackFrameQueue.Count > 0)
     {
         StateCallBackFrame peekFrame = this.mCallBackFrameQueue.Peek();
         if (stateInfo.normalizedTime >= peekFrame.mFrameSecs)
         {
             this.mLocalMotion.OnBehaviourCallBack(this.mCallBackFrameQueue.Dequeue());
         }
     }
 }
コード例 #2
0
 public void OnBehaviourCallBack(StateCallBackFrame callFrameData)
 {
     if (callFrameData.mType == FrameParamType.JumpReady)
     {
         this.mMotion.y = this.mJumpData.CurJumpStrength;
         this.mPlayer.OnReadyJump();
     }
     else if (callFrameData.mType == FrameParamType.BeginFalling)
     {
         this.mPlayer.OnBeginFalling();
     }
     else if (callFrameData.mType == FrameParamType.Attack)
     {
         this.BeginAttack();
     }
     else if (callFrameData.mType == FrameParamType.HoldingAttack)
     {
         this.BeginHoldingAttack();
     }
 }