Example #1
0
        public Axis(int number, string name, AxisTypeEnum type, string plcVariable)
        {
            if (number >= 0)
            {
                AxisNumber = number;
            }
            else
            {
                AxisNumber = 0;
            }

            if (name != null && name != "")
            {
                Name = name;
            }
            else
            {
                Name = "Axis" + AxisNumber.ToString();
            }



            if (plcVariable != null && plcVariable != "")
            {
                PLCVarName = plcVariable;
            }
            else
            {
                PLCVarName = "NONE" + AxisNumber.ToString();
            }

            Type = type;
        }
Example #2
0
 public static InputConfiguration ConfigureMouseMovement(
     this InputConfiguration inputConfiguration,
     AxisNumber axisNumber)
 {
     return(inputConfiguration
            .SetTypeMouseMovement(axisNumber));
 }
Example #3
0
 public static InputConfiguration ConfigureJoystickAxis(
     this InputConfiguration inputConfiguration,
     JoystickNumber joystickNumber,
     AxisNumber axisNumber)
 {
     return(inputConfiguration
            .SetTypeJoystickAxis(joystickNumber, axisNumber));
 }
Example #4
0
 public static InputConfiguration SetTypeMouseMovement(
     this InputConfiguration inputConfiguration,
     AxisNumber axisNumber)
 {
     return(inputConfiguration.Configure(
                axisType: AxisType.MouseMovement,
                joystickNumber: JoystickNumber.AllJoysticks,
                axisNumber: axisNumber,
                sensitivity: 1));
 }
Example #5
0
        public override int GetHashCode()
        {
            var hashCode = 1490284165;

            hashCode = hashCode * -1521134295 + AxisNumber.GetHashCode();
            hashCode = hashCode * -1521134295 + Value.GetHashCode();
            hashCode = hashCode * -1521134295 + Priority.GetHashCode();
            hashCode = hashCode * -1521134295 + Duration.GetHashCode();
            return(hashCode);
        }
Example #6
0
 public static InputConfiguration SetTypeJoystickAxis(
     this InputConfiguration inputConfiguration,
     JoystickNumber joystickNumber,
     AxisNumber axisNumber)
 {
     return(inputConfiguration.Configure(
                axisType: AxisType.JoystickAxis,
                joystickNumber: joystickNumber,
                axisNumber: axisNumber,
                sensitivity: 1));
 }
Example #7
0
        /// <summary>
        /// Adds a new axis to the InputManager.
        /// </summary>
        /// <param name="axesProperty">The array of all of the axes.</param>
        /// <param name="name">The name of the new axis.</param>
        /// <param name="negativeButton">The name of the negative button of the new axis.</param>
        /// <param name="positiveButton">The name of the positive button of the new axis.</param>
        /// <param name="altNegativeButton">The name of the alternative negative button of the new axis.</param>
        /// <param name="altPositiveButton">The name of the alternative positive button of the new axis.</param>
        /// <param name="sensitivity">The sensitivity of the new axis.</param>
        /// <param name="gravity">The gravity of the new axis.</param>
        /// <param name="dead">The dead value of the new axis.</param>
        /// <param name="snap">Does the new axis snap?</param>
        /// <param name="axisType">The type of axis to add.</param>
        public static void AddInputAxis(SerializedProperty axesProperty, string name, string negativeButton, string positiveButton,
                                        string altNegativeButton, string altPositiveButton, float gravity, float dead, float sensitivity, bool snap, bool invert, AxisType axisType, AxisNumber axisNumber)
        {
            var property = FindAxisProperty(axesProperty, name);

            property.FindPropertyRelative("m_Name").stringValue            = name;
            property.FindPropertyRelative("negativeButton").stringValue    = negativeButton;
            property.FindPropertyRelative("positiveButton").stringValue    = positiveButton;
            property.FindPropertyRelative("altNegativeButton").stringValue = altNegativeButton;
            property.FindPropertyRelative("altPositiveButton").stringValue = altPositiveButton;
            property.FindPropertyRelative("gravity").floatValue            = gravity;
            property.FindPropertyRelative("dead").floatValue        = dead;
            property.FindPropertyRelative("sensitivity").floatValue = sensitivity;
            property.FindPropertyRelative("snap").boolValue         = snap;
            property.FindPropertyRelative("invert").boolValue       = invert;
            property.FindPropertyRelative("type").intValue          = (int)axisType;
            property.FindPropertyRelative("axis").intValue          = (int)axisNumber;
        }