public void OnGUI()
        {
            EditorGUILayout.BeginVertical();
            GUILayout.Label(_QuestionText, _WordWrapStyle, GUILayout.ExpandWidth(true));
            GUILayout.FlexibleSpace();

            GUILayout.BeginHorizontal();
            GUILayout.Space(10);
            if (GUILayout.Button("Yes"))
            {
                OnConfirm?.Invoke();
                OnButton?.Invoke(true);
                Close();
            }
            GUILayout.Space(10);

            if (GUILayout.Button("No"))
            {
                OnButton?.Invoke(false);
                Close();
            }
            GUILayout.Space(10);

            GUILayout.EndHorizontal();
            GUILayout.Space(10);
            EditorGUILayout.EndVertical();
        }
Beispiel #2
0
        public void RemoveButtonCall(int player, string action, OnButton callback)
        {
            int actionInd = GetActionIndex(action);

            if (actionInd != -1)
            {
                RemoveButtonCall(player, actionInd, callback);
            }
        }
Beispiel #3
0
        public void RemoveButtonCall(int player, int action, OnButton callback)
        {
            if (action < mBinds.Length && player < mBinds[action].players.Length)
            {
                PlayerData pd = mBinds[action].players[player];

                mButtonCallSetQueue[mButtonCallSetQueueCount] = new ButtonCallSetData()
                {
                    pd = pd, cb = callback, add = false
                };
                mButtonCallSetQueueCount++;
            }
        }
 public void CheckInput()
 {
     if (Input.GetButtonDown(ButtonName))
     {
         OnButtonDown?.Invoke();
     }
     if (Input.GetButtonUp(ButtonName))
     {
         OnButtonUp?.Invoke();
     }
     if (Input.GetButton(ButtonName))
     {
         OnButton?.Invoke();
     }
 }
Beispiel #5
0
 public void RemoveButtonCall(OnButton callback)
 {
     for (int i = 0; i < mBinds.Length; i++)
     {
         for (int j = 0; j < mBinds[i].players.Length; j++)
         {
             PlayerData pd = mBinds[i].players[j];
             if (pd.callback == callback)
             {
                 mButtonCallSetQueue[mButtonCallSetQueueCount] = new ButtonCallSetData()
                 {
                     pd = pd, cb = callback, add = false
                 };
                 mButtonCallSetQueueCount++;
             }
         }
     }
 }
 public void PointerEnter()
 {
     OnButton.Play();
 }
Beispiel #7
0
 public void ExitAll()
 {
     gazedBtn = OnButton.NONE;
 }
Beispiel #8
0
 public void EnterExit()
 {
     gazedBtn = OnButton.EXIT;
 }
Beispiel #9
0
 public void EnterDown()
 {
     gazedBtn = OnButton.DOWN;
 }
Beispiel #10
0
 public void EnterUp()
 {
     gazedBtn = OnButton.UP;
 }
Beispiel #11
0
 public void EnterRight()
 {
     gazedBtn = OnButton.RIGHT;
 }
Beispiel #12
0
 public void EnterLeft()
 {
     gazedBtn = OnButton.LEFT;
 }
Beispiel #13
0
    //Private Methods

    void Awake()
    {
        gazedBtn = OnButton.NONE;
    }
Beispiel #14
0
 private void OnWindowButtonPress(WindowHandle *window, Keys key, int scanCode, InputAction action, KeyModifiers mods)
 => OnButton?.Invoke(key, action, mods);
Beispiel #15
0
        private void Update()
        {
            if (SDL_Installed && !SDL_Initialized)
            {
                InitSDL();
            }
            if (!SDL_Initialized)
            {
                return;
            }

            SDL.SDL_Event e;

            while (SDL.SDL_PollEvent(out e) > 0)
            {
                switch (e.type)
                {
                case SDL.SDL_EventType.SDL_KEYDOWN:
                    OnKey?.Invoke(e, true);
                    break;

                case SDL.SDL_EventType.SDL_KEYUP:
                    OnKey?.Invoke(e, false);
                    break;

                case SDL.SDL_EventType.SDL_CONTROLLERAXISMOTION:
                    OnAxisMotion?.Invoke(e);
                    break;

                case SDL.SDL_EventType.SDL_CONTROLLERBUTTONDOWN:
                    OnButton?.Invoke(e, true);
                    break;

                case SDL.SDL_EventType.SDL_CONTROLLERBUTTONUP:
                    OnButton?.Invoke(e, false);
                    break;

                case SDL.SDL_EventType.SDL_CONTROLLERDEVICEADDED:
                    Controller.AddDevice(e.cdevice.which);
                    OnDeviceAdded?.Invoke(e);
                    break;

                case SDL.SDL_EventType.SDL_CONTROLLERDEVICEREMOVED:
                    Controller.RemoveDisconnected();
                    OnDeviceRemoved?.Invoke(e);
                    break;

                case SDL.SDL_EventType.SDL_CONTROLLERDEVICEREMAPPED:
                    OnDeviceRemapped?.Invoke(e);
                    break;

                case SDL.SDL_EventType.SDL_JOYAXISMOTION:
                    OnAxisMotion?.Invoke(e);
                    break;

                case SDL.SDL_EventType.SDL_JOYBALLMOTION:
                    OnBallMotion?.Invoke(e);
                    break;

                case SDL.SDL_EventType.SDL_JOYHATMOTION:
                    OnHatMotion?.Invoke(e);
                    break;

                case SDL.SDL_EventType.SDL_JOYBUTTONDOWN:
                    OnButton?.Invoke(e, true);
                    break;

                case SDL.SDL_EventType.SDL_JOYBUTTONUP:
                    OnButton?.Invoke(e, false);
                    break;

                case SDL.SDL_EventType.SDL_JOYDEVICEADDED:
                    Controller.AddDevice(e.jdevice.which);
                    OnDeviceAdded?.Invoke(e);
                    break;

                case SDL.SDL_EventType.SDL_JOYDEVICEREMOVED:
                    Controller.RemoveDisconnected();
                    OnDeviceRemoved?.Invoke(e);
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #16
0
 public void RemoveButtonCall(InputAction action, OnButton callback)
 {
     mBinds[(int)action].callback -= callback;
 }
Beispiel #17
0
 public void AddButtonCall(InputAction action, OnButton callback)
 {
     mBinds[(int)action].callback += callback;
 }