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