Exemple #1
0
        public virtual bool InternalCleanupTestable(bool bRunningTestInEditor = false)
        {
            if (!bRunningTestInEditor || (TestRunnerInst.CurrentTest != null && TestRunnerInst.CurrentTest.bForceLoadToFirstSceneInEditor))
            {
                string FirstLevelName = IgorUtils.GetFirstLevelName();

                if (FirstLevelName != "")
                {
                    if (EditorApplication.currentScene != FirstLevelName)
                    {
                        EditorApplication.OpenScene(FirstLevelName);

                        return(false);
                    }
                }
            }

            MonsterStarter[] Starters = GameObject.FindObjectsOfType <MonsterStarter>();

            foreach (MonsterStarter CurrentStarter in Starters)
            {
                GameObject.DestroyImmediate(CurrentStarter.gameObject);
            }

            if (!bRunningTestInEditor)
            {
                string StreamingAssetsFolder = Path.Combine("Assets", Path.Combine("StreamingAssets", Path.Combine("Igor", Path.Combine("Monster", "Config"))));

                if (Directory.Exists(StreamingAssetsFolder))
                {
                    IgorRuntimeUtils.DeleteDirectory(StreamingAssetsFolder);
                }

                string LastValue = IgorJobConfig.GetStringParam(LastDisplayResolutionDialogFlag);

                switch (LastValue)
                {
                case "Disabled":
                    PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.Disabled;
                    break;

                case "Enabled":
                    PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.Enabled;
                    break;

                case "HiddenByDefault":
                    PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.HiddenByDefault;
                    break;
                }
            }

            return(true);
        }
Exemple #2
0
        public virtual bool RebuildAmplify()
        {
            string FirstLevelName = IgorUtils.GetFirstLevelName();

            if (FirstLevelName != "")
            {
                if (EditorApplication.currentScene != FirstLevelName)
                {
                    Log("Opening scene " + FirstLevelName);

                    EditorApplication.OpenScene(FirstLevelName);

                    return(false);
                }
            }

            Log("Triggering rebuild of Amplify Texture VTs.");

            TriggerRebuildAllVTsInScene(AmplifyTexture.InternalEditor.Instance);

            return(true);
        }
Exemple #3
0
        public virtual bool InternalBuildTestable(bool bRunningTestInEditor = false)
        {
            if (!bRunningTestInEditor)
            {
                if (!IgorSetScriptingDefines.ExtraModuleParams.Contains("MONSTER_TEST_RUNTIME"))
                {
                    IgorSetScriptingDefines.ExtraModuleParams += ";MONSTER_TEST_RUNTIME";
                }

                if (!IgorSetScriptingDefines.ExtraModuleParams.Contains("IGOR_RUNTIME"))
                {
                    IgorSetScriptingDefines.ExtraModuleParams += ";IGOR_RUNTIME";
                }

                IgorJobConfig.SetStringParam(LastDisplayResolutionDialogFlag, PlayerSettings.displayResolutionDialog.ToString());

                PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.Disabled;
            }

            if (!bRunningTestInEditor || (TestRunnerInst.CurrentTest != null && TestRunnerInst.CurrentTest.bForceLoadToFirstSceneInEditor))
            {
                string FirstLevelName = IgorUtils.GetFirstLevelName();

                if (FirstLevelName != "")
                {
                    if (EditorApplication.currentScene != FirstLevelName)
                    {
                        EditorApplication.OpenScene(FirstLevelName);

                        return(false);
                    }
                }
            }

            if (MonsterStarter.GetInstance() == null)
            {
                GameObject MonsterStarterInst = new GameObject("MonsterTestStarter");

                MonsterStarterInst.AddComponent <MonsterStarter>();

                EditorApplication.SaveScene();
            }

            if (!bRunningTestInEditor)
            {
                string StreamingAssetsFolder = Path.Combine("Assets", Path.Combine("StreamingAssets", Path.Combine("Igor", Path.Combine("Monster", "Config"))));

                if (Directory.Exists(StreamingAssetsFolder))
                {
                    MonsterDebug.LogError("Attempting to overwrite the " + StreamingAssetsFolder + ", but it already exists!");

                    IgorRuntimeUtils.DeleteDirectory(StreamingAssetsFolder);

                    Directory.CreateDirectory(StreamingAssetsFolder);
                }
                else
                {
                    Directory.CreateDirectory(StreamingAssetsFolder);
                }

                string ConfigRoot = Path.Combine(MonsterTestCore.MonsterLocalDirectoryRoot, "Config");

                if (Directory.Exists(ConfigRoot))
                {
                    IgorRuntimeUtils.DirectoryCopy(ConfigRoot, StreamingAssetsFolder, true);
                }
            }

            return(true);
        }