Esempio n. 1
0
 public float GetAxis(CommonAxis axis)
 {
     if (device.TryGetFeatureValue(GetCommonAxis(axis), out float axisValue))
     {
         return(axisValue);
     }
     return(0);
 }
Esempio n. 2
0
    float CalculateOffset(CommonAxis axis, float localPosition, float speed, float range)
    {
        float axisThrow = CrossPlatformInputManager.GetAxis(axis.ToString());
        float offset    = axisThrow * Time.deltaTime * speed;
        float raw       = Mathf.Clamp(localPosition + offset, -range, range);

        return(raw);
    }
Esempio n. 3
0
 public static InputFeatureUsage <float> GetCommonAxis(CommonAxis axis)
 {
     if (axis == CommonAxis.grip)
     {
         return(CommonUsages.grip);
     }
     else
     {
         return(CommonUsages.trigger);
     }
 }