Esempio n. 1
0
        public Axis(string name, ET.StandaloneAxisType axisType, string unityAxisName)
        {
            m_AxisName = name;
            m_AxisType = axisType;

            m_UnityAxisName = unityAxisName;
        }
Esempio n. 2
0
        public Axis(string name, ET.StandaloneAxisType axisType, Joystick joystick)
        {
            m_AxisName = name;
            m_AxisType = axisType;

            // m_JoyStick = joystick;
        }
Esempio n. 3
0
        public Axis(string name, ET.StandaloneAxisType axisType, KeyCode positiveKey, KeyCode negativeKey, string unityAxisName)
        {
            m_AxisName = name;
            m_AxisType = axisType;

            m_PositiveKey = positiveKey;
            m_NegativeKey = negativeKey;

            m_UnityAxisName = unityAxisName;
        }
Esempio n. 4
0
        private void OnEnable()
        {
            Undo.undoRedoPerformed += Repaint;

            LookForData();

            SerializedProperty buttonsProperty = m_SerializedInputData.FindProperty("m_Buttons");

            m_ButtonReorderables = new ReorderableList(m_SerializedInputData, buttonsProperty);

            m_ButtonReorderables.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
            {
                EditorGUI.PropertyField(new Rect(rect.x, rect.y, 200, EditorGUIUtility.singleLineHeight), buttonsProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_ButtonName"));

                EditorGUI.PropertyField(new Rect(rect.x + 250, rect.y, 200, EditorGUIUtility.singleLineHeight), buttonsProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_Key"));
            };

            SerializedProperty axesProperty = m_SerializedInputData.FindProperty("m_Axes");

            m_AxesReorderables = new ReorderableList(m_SerializedInputData, axesProperty);

            m_AxesReorderables.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
            {
                EditorGUI.PropertyField(new Rect(rect.x, rect.y, 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_AxisName"));

                ET.StandaloneAxisType axisType = (ET.StandaloneAxisType)axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_AxisType").enumValueIndex;

                EditorGUI.PropertyField(new Rect(rect.x + 250, rect.y, 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_AxisType"));

                if (axisType == ET.StandaloneAxisType.Custom)
                {
                    EditorGUI.PropertyField(new Rect(rect.x + 500, rect.y, 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_Normalize"));

                    EditorGUI.PropertyField(new Rect(rect.x, rect.y + (EditorGUIUtility.singleLineHeight + 5), 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_PositiveKey"));
                    EditorGUI.PropertyField(new Rect(rect.x + 250, rect.y + (EditorGUIUtility.singleLineHeight + 5), 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_NegativeKey"));
                }
                else if (axisType == ET.StandaloneAxisType.Unity)
                {
                    EditorGUI.PropertyField(new Rect(rect.x + 500, rect.y, 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_UnityAxisName"));
                }
                else
                {
                    EditorGUI.PropertyField(new Rect(rect.x + 500, rect.y, 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_UnityAxisName"));
                    EditorGUI.PropertyField(new Rect(rect.x, rect.y + (EditorGUIUtility.singleLineHeight + 5), 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_Normalize"));

                    EditorGUI.PropertyField(new Rect(rect.x, rect.y + ((EditorGUIUtility.singleLineHeight * 2) + 10), 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_PositiveKey"));
                    EditorGUI.PropertyField(new Rect(rect.x, rect.y + ((EditorGUIUtility.singleLineHeight * 2) + 10), 200, EditorGUIUtility.singleLineHeight), axesProperty.GetArrayElementAtIndex(index).FindPropertyRelative("m_NegativeKey"));
                }
            };

            m_AxesReorderables.elementHeight = 40f;
        }
Esempio n. 5
0
 public Axis(string name, ET.StandaloneAxisType axisType)
 {
     m_AxisName = name;
     m_AxisType = axisType;
 }