static void Update() { bool timerIsRunning = EditorPrefs.GetBool("TimeTools." + Application.productName + ".TimerIsRunning", false); if (timerIsRunning) { double timerTimeRemove = double.Parse(EditorPrefs.GetString("TimeTools." + Application.productName + ".TimerTimeRemove", "0")); double timerTime = TimerWindow.timeToWait - timerTimeRemove - (EditorApplication.timeSinceStartup - TimerWindow.startCoundownTime); if (timerTime <= 0) { TimerWindow.FireAlarm(); } } }
public static void OpenWindow() { if (window == null) { window = (TimerWindow)GetWindow(typeof(TimerWindow)); wTitle.text = "Timer"; wTitle.image = EditorGUIUtility.IconContent("UnityEditor.ProfilerWindow").image; wTitle.tooltip = "Use this tool as a usual timer"; window.minSize = new Vector2(300f, 130f); window.maxSize = window.minSize; window.titleContent = wTitle; } window.Show(); }
static void Start() { ChronometerWindow.ClearData(); TimerWindow.ClearData(); }