using UnityEditor; using UnityEngine; using UnityEngine.UIElements; namespace CartoonFX { [InitializeOnLoad] public class CFXR_WelcomeScreen : EditorWindow { static CFXR_WelcomeScreen() { EditorApplication.delayCall += () => { if (SessionState.GetBool("CFXR_WelcomeScreen_Shown", false)) { return; } SessionState.SetBool("CFXR_WelcomeScreen_Shown", true); var importer = AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath("bfd03f272fe010b4ba558a3bc456ffeb")); if (importer != null && importer.userData == "dontshow") { return; } Open(); }; } [MenuItem("Tools/Cartoon FX Remaster FREE - Welcome Screen")] static void Open() { var window = GetWindow(true, "Cartoon FX Remaster FREE", true); window.minSize = new Vector2(516, 370); window.maxSize = new Vector2(516, 370); } private void CreateGUI() { VisualElement root = rootVisualElement; root.style.height = new StyleLength(new Length(100, LengthUnit.Percent)); // UXML var uxmlDocument = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath("bfd03f272fe010b4ba558a3bc456ffeb")); root.Add(uxmlDocument.Instantiate()); // USS var styleSheet = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath("f8b971f10a610844f968f582415df874")); root.styleSheets.Add(styleSheet); // Background image root.style.backgroundImage = new StyleBackground(AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath("fed1b64fd853f994c8d504720a0a6d44"))); root.style.unityBackgroundScaleMode = ScaleMode.ScaleAndCrop; // Logo image var titleImage = root.Q("img_title"); titleImage.image = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath("a665b2e53088caa4c89dd09f9c889f62")); // Buttons root.Q