Пример #1
0
 // Rebinding Keys
 public void HardStartRebind(string keyNameGET, bool wantSecond, hardInputUI inputFrom)
 {
     //print("Rebinding: " + keyNameGET);
     currentBindFrom = inputFrom;
     replaceSecond   = wantSecond;
     currentRebind   = keyNameGET;
     StartCoroutine(waitForKeyPress());
 }
Пример #2
0
        public override void OnInspectorGUI()
        {
            parentScript = (hardInputUI)target;

            parentScript.buttonAction = EditorGUILayout.Popup("Hard UI Type", parentScript.buttonAction, uivalues);

            if (parentScript.buttonAction == 0)
            {
                // Display text
                if (parentScript.displayText == null)
                {
                    GUI.color = Color.red;
                }
                else
                {
                    GUI.color = Color.green;
                }

                parentScript.displayText = (Text)EditorGUILayout.ObjectField("UI Text Object", parentScript.displayText, typeof(Text), true);
                GUI.color = Color.white;
                // End
            }


            if (parentScript.buttonAction == 0 || parentScript.buttonAction == 1)
            {
                // Display text
                if (parentScript.keyName == "")
                {
                    GUI.color = Color.red;
                }
                else if (nameExists(parentScript.keyName))
                {
                    GUI.color = Color.green;
                }
                else
                {
                    GUI.color = Color.yellow;
                }

                parentScript.keyName = EditorGUILayout.TextField("Key Name", parentScript.keyName);
                GUI.color            = Color.white;
                // End
            }

            if (parentScript.buttonAction == 0)
            {
                parentScript.useSecondary = EditorGUILayout.Toggle("Target Secondary Key", parentScript.useSecondary);
            }
        }
Пример #3
0
        public void HardStartRebind(string keyNameGET, bool wantSecond, KeyCode inputFrom)
        {
            //print("Rebinding: " + keyNameGET);
            currentBindFrom = null;
            replaceSecond   = wantSecond;
            currentRebind   = keyNameGET;
            //StartCoroutine(waitForKeyPress());
            int axis = 0;

            if (inputFrom.ToString().Contains("Joystick1Button") && useController)
            {
                axis = 5;

                //print(inputFrom);
                hardRebind(currentRebind, inputFrom, axis);
            }
            else if (!inputFrom.ToString().Contains("Joystick"))
            {
                hardRebind(currentRebind, inputFrom, axis);
            }
        }