Example #1
0
 protected override void UpdateHandler()
 {
     //if (inputEventArgs.Data.HorizVertAxis.magnitude != 0)
     if (Facade.GetAxis(InputAxisType.Vertical) != 0 || Facade.GetAxis(InputAxisType.Horizontal) != 0)
     {
         animator.SetBool(inputHash, true);
     }
     else
     {
         animator.SetBool(inputHash, false);
     }
     moveForword = Facade.GetAxis(InputAxisType.Vertical);
     moveTurn    = Facade.GetAxis(InputAxisType.Horizontal);
     if (Facade.GetButton(InputButtonType.LeftShift))
     {
         moveForword *= 2;
     }
     //合并旋转
     MatchRotation();
     //{
     //    if (dot >= 0)
     //    {
     //        moveTurn += (1-dot);
     //    }
     //    else
     //    {
     //        //?????
     //    }
     //}
     animator.SetFloat(forwardHash, moveForword, forwardDampTime, Time.deltaTime);
     animator.SetFloat(turnHash, moveTurn, turnDampTime, Time.deltaTime);
 }