Beispiel #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);
 }
Beispiel #2
0
 protected override void UpdateHandler()
 {
     yaw   = -Facade.GetAxis(InputAxisType.MouseX);
     pitch = Facade.GetAxis(InputAxisType.MouseY);
     pitch = Mathf.Clamp(pitch, pitchMinMax.x, pitchMinMax.y);
     if (Facade.GetAxis(InputAxisType.MouseScrollWheel) != 0)
     {
         Utility.Debug.LogInfo("MouseScrollWheel ", MessageColor.INDIGO);
     }
     distanceFromTarget -= Facade.GetAxis(InputAxisType.MouseScrollWheel);
     distanceFromTarget  = Mathf.Clamp(distanceFromTarget, 0.5f, 10);
     HideMouse();
 }