void OnDestroy() { if (instance == this) { instance = null; } }
public static void ShowWindow() { if (instance == null) { instance = CreateInstance <BankRefreshWindow>(); instance.titleContent = new GUIContent("FMOD Bank Refresh Status"); instance.minSize = new Vector2(400, 200); instance.maxSize = new Vector2(1000, 200); instance.ShowUtility(); } }
void OnEnable() { serializedSettings = new SerializedObject(Settings.Instance); cooldown = serializedSettings.FindProperty("BankRefreshCooldown"); showWindow = serializedSettings.FindProperty("ShowBankRefreshWindow"); // instance is set to null when scripts are recompiled if (instance == null) { instance = this; } else if (instance != this) { Close(); } }
private static void CheckSourceFilesChanged() { if (sourceFilesChanged) { lastSourceFileChange = Time.realtimeSinceStartup; sourceFilesChanged = false; if (!BankRefreshWindow.IsVisible) { autoRefresh = true; } if (IsWindowEnabled()) { BankRefreshWindow.ShowWindow(); } } }
public static void HandleBankRefresh(string result) { lastSourceFileChange = float.MaxValue; BankRefreshWindow.HandleBankRefresh(result); }