Ejemplo n.º 1
0
        private static void AddDefineIfMissingAndShowWelcomeScreenIfNotShown()
        {
            if (!ApplicationUtility.IsReady())
            {
                EditorApplication.delayCall += AddDefineIfMissingAndShowWelcomeScreenIfNotShown;
                return;
            }

            if (!ScriptingDefines.Contains(Define))
            {
                                #if DEV_MODE
                EditorPrefs.SetBool("PI.WelcomeScreenShown", false);                 // this makes testing welcome screen showing up easier
                                #endif

                UnityEngine.Debug.Log("Detected install of Power Inspector. Adding " + Define + " to Scripting Define Symbols in Player Settings.");
                ScriptingDefines.Add(Define);
                return;
            }

            if (ShouldShowWelcomeScreen())
            {
                // A NullReferenceException would occur in Unity 2019.3 beta when ShowUtility was called for the Welcome Screen without this delay
                EditorApplication.delayCall += ShowWelcomeScreen;
            }
        }
Ejemplo n.º 2
0
        private static AssetDeleteResult OnWillDeleteAsset(string assetPath, RemoveAssetOptions options)
        {
                        #if DEV_MODE && DEBUG_ENABLED
            UnityEngine.Debug.Log("OnWillDeleteAsset: " + assetPath + " " + options);
                        #endif

            if (assetPath.EndsWith("Inspector/PowerInspector/PowerInspector.cs", StringComparison.Ordinal))
            {
                UnityEngine.Debug.Log("Detected uninstall of Power Inspector. Removing POWER_INSPECTOR define from Scripting Define Symbols in Player Settings.");

                ScriptingDefines.Remove("POWER_INSPECTOR");
                ScriptingDefines.Remove("DEV_MODE");
            }

            return(AssetDeleteResult.DidNotDelete);
        }