Exemple #1
0
        public void Initialize(GlowingButton button)
        {
            Teardown();

            _button = button;
            _button.onKeyStateChanged += OnButtonStateChanged;
        }
        public void Initialize(GlowingButton button)
        {
            Teardown();

            _button = button;
            _button.onKeyStateChanged += OnButtonStateChanged;
            _button.ledFunction        = _button.isPressedFunction;
        }
Exemple #3
0
        public void Initialize(GlowingButton button)
        {
            Teardown();

            _button = button;
            _button.onKeyStateChanged += OnButtonStateChanged;
            //_button.ledFunction = LedFunctions.LedDelegate(() => _)
        }
Exemple #4
0
        public void Initialize(GlowingButton button)
        {
            _button = button;
            _button.onKeyStateChanged += OnButtonStateChanged;

            //_currentFrequency = 0;
            _flashingLedFunction = new LedFlashing(_frequencies[_currentFrequency]);
            _button.ledFunction  = _flashingLedFunction;
        }
Exemple #5
0
 public void Teardown()
 {
     if (_button != null)
     {
         _button.onKeyStateChanged -= OnButtonStateChanged;
         _button.ledFunction        = null;
         _button = null;
     }
 }
 public bool GetLedState(GlowingButton button)
 {
     if (_ledStateDelegate != null)
     {
         return(_ledStateDelegate());
     }
     else
     {
         return(false);
     }
 }
Exemple #7
0
 public bool GetLedState(GlowingButton button)
 {
     if (_screenSaverHandler != null)
     {
         return(button.position == _screenSaverHandler.currentPosition);
     }
     else
     {
         return(false);
     }
 }
        public void Teardown()
        {
            if (_button != null)
            {
                _button.onKeyStateChanged -= OnKeyStateChanged;
                _button.ledFunction        = null;
                _button = null;
            }

            DeleteStoredDataButtonHandler.UnregisterDeleter(this);
        }
Exemple #9
0
        public void Initialize(GlowingButton button)
        {
            _button = button;
            _button.onKeyStateChanged += OnKeyStateChanged;

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(isWindowMaximized);
            });

            _button.ledFunction = _defaultLedFunction;
        }
        public void Initialize(GlowingButton button)
        {
            Teardown();

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(UnityEditor.ActiveEditorTracker.sharedTracker.isLocked && LedFunctions.LedFlashing.fast.GetLedState(button));
            });

            _button = button;
            _button.onKeyStateChanged += OnButtonStateChanged;
            _button.ledFunction        = _defaultLedFunction;
        }
Exemple #11
0
        public void Initialize(GlowingButton button)
        {
            Teardown();

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return((Selection.gameObjects.Length > 0) && Selection.gameObjects.All((x) => x.activeSelf == true));
            });

            _button = button;
            _button.onKeyStateChanged += OnButtonStateChanged;
            _button.ledFunction        = _defaultLedFunction;
        }
        public void Initialize(GlowingButton button)
        {
            Teardown();

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(SceneView.lastActiveSceneView != null && SceneView.lastActiveSceneView.drawGizmos);
            });

            _button = button;
            _button.onKeyStateChanged += OnButtonStateChanged;
            _button.ledFunction        = _defaultLedFunction;
        }
        public void Initialize(GlowingButton button)
        {
            _button = button;
            _button.onKeyStateChanged += OnKeyStateChanged;

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(_button.key || _hasSavedData);
            });

            _button.ledFunction = _defaultLedFunction;

            DeleteStoredDataButtonHandler.RegisterDeleter(this);
        }
Exemple #14
0
        public void Initialize(GlowingButton button)
        {
            _button = button;
            _button.onKeyStateChanged += OnKeyStateChanged;

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(_button.key ||
                       (_hasSavedData && ((areObjectsSelected && LedFunctions.LedFlashing.slow.GetLedState(button)) || !areObjectsSelected)));
            });

            _button.ledFunction = _defaultLedFunction;

            DeleteStoredDataButtonHandler.RegisterDeleter(this);
        }
        public void Initialize(GlowingButton button)
        {
            _button = button;
            _button.onKeyStateChanged += OnKeyStateChanged;

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(_button.key ||
                       (isWindowFocused && LedFunctions.LedFlashing.slow.GetLedState(button)) ||
                       (_hasSavedData && !isWindowFocused));
            });

            _button.ledFunction = _defaultLedFunction;

            DeleteStoredDataButtonHandler.RegisterDeleter(this);

            if (!string.IsNullOrEmpty(_focusedWindowTypeName) && _hasSavedData)
            {
                _focusedWindowType = System.Type.GetType(_focusedWindowTypeName);
            }
        }
Exemple #16
0
        public void Initialize(GlowingButton button)
        {
            Teardown();

            int totalButtons = GridController.grid.width * GridController.grid.height;

            _cellWeights = new List <int>(GridController.grid.width * GridController.grid.height);
            for (int i = 0; i < totalButtons; i++)
            {
                _cellWeights.Add(1);
            }

            _ledFunction = new ScreenSaverLedFunction(this);

            _button = button;
            _button.onKeyStateChanged += OnButtonStateChanged;
            _button.ledFunction        = LedOn.instance;

            _overrideButton = new GlowingButton(0, 0);
            _overrideButton.onKeyStateChanged += OnOverrideButtonStateChanged;
        }
Exemple #17
0
        public bool GetLedState(GlowingButton button)
        {
            if (button.position == DeleteStoredDataButtonHandler.currentDeletePosition)
            {
                return(true);
            }

            IButtonHandler buttonHandler = GridController.gridConfig.GetButtonHandler(button.x, button.y);

            float   time   = (float)(UnityEditor.EditorApplication.timeSinceStartup - startTime) * frequency;
            Vector2 offset = DeleteStoredDataButtonHandler.currentDeletePosition - button.position;

            time -= offset.magnitude * 0.05f;

            if (buttonHandler != null &&
                buttonHandler is IDeleteStoredData &&
                (buttonHandler as IDeleteStoredData).HasStoredData)
            {
                IDeleteStoredData deleter = buttonHandler as IDeleteStoredData;
                return(time > 0 && (time < dutyCycleNormal || Mathf.Repeat((float)UnityEditor.EditorApplication.timeSinceStartup * frequency, 1) < dutyCycleOn));
            }

            return(time > 0 && time < dutyCycleNormal);
        }
 public bool GetLedState(GlowingButton button)
 {
     return(Mathf.Repeat((float)UnityEditor.EditorApplication.timeSinceStartup * frequency, 1.0f) > (1.0f - dutyCycle));
 }
Exemple #19
0
 public void Teardown()
 {
     _button.ledFunction = null;
     _button             = null;
 }
Exemple #20
0
 public bool GetLedState(GlowingButton button)
 {
     return(false);
 }
 public bool GetLedState(GlowingButton button)
 {
     return(((int)((UnityEditor.EditorApplication.timeSinceStartup + (button.x * xTimeOffset + button.y * yTimeOffset)) * frequency) % 2) == 1);
 }
Exemple #22
0
 public void Initialize(GlowingButton button)
 {
     _button = button;
     _button.onKeyStateChanged += OnButtonStateChanged;
     _button.ledFunction        = LedFunctions.LedOff.instance;
 }