Beispiel #1
0
        public override void OnUpdate()
        {
            if (Input.GetKeyUp(Key))
            {
                State = !State;
            }

            if (State && !prevState)
            {
                OnEnable?.Invoke();
                OnToggle?.Invoke();
            }
            else if (!State && prevState)
            {
                OnDisable?.Invoke();
                OnToggle?.Invoke();
            }


            if (State)
            {
                Funky?.Invoke();
            }

            prevState = State;
        }
Beispiel #2
0
    public void Enable()
    {
        _isActiveInput   = true;
        _scrollDirection = Vector2Int.zero;


        OnEnable?.Invoke();
    }
Beispiel #3
0
 public void SetActive()
 {
     setActiveDelegate(this);
     if (!active)
     {
         OnEnable?.Invoke(this);
     }
     active = true;
 }
Beispiel #4
0
 public void Switch()
 {
     if (select == ESelect.DISABLE)
     {
         select = ESelect.ENABLE;
         OnEnable?.Invoke(entity);
     }
     else
     {
         select = ESelect.DISABLE;
         OnDisable?.Invoke(entity);
     }
 }
 private ApplicationLauncherButton BuildButton()
 {
     return(ApplicationLauncher.Instance.AddModApplication(
                onTrue: () => OnEnable?.Invoke(),
                onFalse: () => OnDisable?.Invoke(),
                onHover: null,
                onHoverOut: null,
                onEnable: null,
                onDisable: null,
                visibleInScenes: ApplicationLauncher.AppScenes.ALWAYS,          /* MAPVIEW does not work in 1.2.2 */
                texture: m_texture
                ));
 }
Beispiel #6
0
        public void Enable()
        {
            if (IsLocked)
            {
                return;
            }

            IsEnabled = true;
            if (IsPurchased || IsGroup)
            {
                Children.ForEach(child => child.Enable());
            }

            OnEnable.Invoke();
        }
Beispiel #7
0
        LRESULT WndProc(HWND hwnd, WM msg, WPARAM wParam, LPARAM lParam)
        {
            switch (msg)
            {
            case WM.CLOSE:
                OnClose?.Invoke();
                if (DestroyWhenClose == null || DestroyWhenClose())
                {
                    User32.DestroyWindow(hwnd);
                }
                return(0);

            case WM.ENABLE:
                OnEnable?.Invoke(wParam);
                break;

            case WM.SHOWWINDOW:
                OnShow?.Invoke(wParam);
                break;

            case WM.DESTROY:
                OnDestroy?.Invoke();
                return(0);

            case WM.MOUSEMOVE:
                OnMouseMove?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.LBUTTONDOWN:
                OnMouseLeftDown?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.LBUTTONUP:
                OnMouseLeftUp?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.LBUTTONDBLCLK:
                OnMouseLeftDoubleClicked?.Invoke();
                return(0);

            case WM.RBUTTONDOWN:
                OnMouseRightDown?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.RBUTTONUP:
                OnMouseRightUp?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.MBUTTONDOWN:
                OnMouseMiddleDown?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.MBUTTONUP:
                OnMouseMiddleUp?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.MOUSEWHEEL:
                OnMouseWheel?.Invoke(wParam.HiWord);
                return(0);

            case WM.RESIZE:
                OnResize?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.PAINT:
            {
                var ps = default(PAINTSTRUCT);
                User32.BeginPaint(hwnd, ref ps);
                OnPaint?.Invoke();
                User32.EndPaint(hwnd, ref ps);
            }
                return(0);
            }
            return(User32.DefWindowProcW(hwnd, msg, wParam, lParam));
        }