public static void ShowWelcome() { if (!EditorPrefs.HasKey("EveryplayWelcomeShown")) { Texture2D texture = (Texture2D)EditorGUIUtility.Load("Everyplay/Images/everyplay-welcome.png"); if (texture != null) { GUIStyle style = new GUIStyle(); style.margin = new RectOffset(0, 0, 0, 0); style.padding = new RectOffset(0, 0, 0, 0); style.alignment = TextAnchor.MiddleCenter; if (style != null) { EditorPrefs.SetBool("EveryplayWelcomeShown", true); EveryplayWelcome window = (EveryplayWelcome)GetWindow(typeof(EveryplayWelcome), true, "Welcome to Everyplay!"); window.position = new Rect(196, 196, texture.width, texture.height); window.minSize = new Vector2(texture.width, texture.height); window.maxSize = new Vector2(texture.width, texture.height); window.welcomeTexture2d = texture; window.welcomeStyle = style; window.Show(); EveryplaySettingsEditor.ShowSettings(); } } } }
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { // Legacy clean (moving asset) often fails during package import, try to do it a couple of times pre import and one time post import foreach (string asset in importedAssets) { if (asset.Trim().Equals("Assets/Plugins/Everyplay/Scripts/EveryplayLegacy.cs")) { Clean(true); EveryplayWelcome.ShowWelcome(); return; } } }
private static void Update() { if (editorFrames > editorFramesToWait) { Clean(true); EveryplayPostprocessor.ValidateEveryplayState(EveryplaySettingsEditor.LoadEveryplaySettings()); EveryplayWelcome.ShowWelcome(); EditorApplication.update -= Update; } else { editorFrames++; } }