Exemple #1
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);
        }
Exemple #2
0
 public static void UnregisterDeleter(IDeleteStoredData deleter)
 {
     __allDeleters.Remove(deleter);
 }
Exemple #3
0
 public static void RegisterDeleter(IDeleteStoredData deleter)
 {
     __allDeleters.Add(deleter);
 }