public static void Init() { StartScreen window = (StartScreen)GetWindow(typeof(StartScreen), true, "Fake Interiors Start Screen"); window.minSize = new Vector2(650, 500); window.maxSize = new Vector2(650, 500); window.Show(); }
static void Update() { EditorApplication.update -= Update; if (!EditorApplication.isPlayingOrWillChangePlaymode) { bool show = false; if (!EditorPrefs.HasKey(Preferences.PrefStartUp)) { show = true; EditorPrefs.SetBool(Preferences.PrefStartUp, true); } else { if (Time.realtimeSinceStartup < 10) { show = EditorPrefs.GetBool(Preferences.PrefStartUp, true); if (!show) { StartScreen.StartBackgroundTask(StartScreen.StartRequest(StartScreen.BannerInfoURL, (www) => { Info info = Info.CreateFromJSON(www.downloadHandler.text); if (info != null) { if (DateTime.Now < DateTime.Parse(info.ShowBefore) && !EditorPrefs.GetBool(Preferences.PrefForceUpdate, false)) { EditorPrefs.SetBool(Preferences.PrefForceUpdate, true); EditorPrefs.SetBool(Preferences.PrefStartUp, true); StartScreen.Init(); } else if (DateTime.Now > DateTime.Parse(info.ShowBefore)) { EditorPrefs.SetBool(Preferences.PrefForceUpdate, false); } } })); } } } if (show) { StartScreen.Init(); } } }