Пример #1
0
        /// <summary>
        /// We compute the axis value from the interval between neutral position, current stick position (vectorPosition) and max range
        /// </summary>
        /// <returns>The axis value, a float between -1 and 1</returns>
        /// <param name="vectorPosition">stick position.</param>
        protected virtual float EvaluateInputValue(float vectorPosition)
        {
            var x = Mathf.InverseLerp(0, MaxRange, Mathf.Abs(vectorPosition));

            MMDebug.DebugOnScreen("input:" + x);
            var y = curveKnob.Evaluate(x) * Mathf.Sign(vectorPosition);

            MMDebug.DebugOnScreen("result:" + y);
            return(y);
            //	return Mathf.Min(1.0f, x)* Mathf.Sign(vectorPosition);
        }
 public virtual void RepositionableJoystickMovement(Vector2 movement)
 {
     MMDebug.DebugOnScreen("Repositionable joystick", movement);
 }
 public virtual void RTPressed()
 {
     MMDebug.DebugOnScreen("Button RT Pressed");
 }
 public virtual void RightJoystickMovement(Vector2 movement)
 {
     MMDebug.DebugOnScreen("right joystick", movement);
 }
 public virtual void LeftJoystickMovement(Vector2 movement)
 {
     MMDebug.DebugOnScreen("left joystick", movement);
 }
 public virtual void VerticalAxisPressed(float value)
 {
     MMDebug.DebugOnScreen("vertical movement", value);
 }
 public virtual void HorizontalAxisPressed(float value)
 {
     MMDebug.DebugOnScreen("horizontal movement", value);
 }
        /// <summary>
        /// On update, outputs a text on screen
        /// </summary>
        void Update()
        {
            float test = (Mathf.Sin(Time.time) + 2) * multiplier;

            MMDebug.DebugOnScreen(Label, test);
        }