Beispiel #1
0
        public static void SetNewModuleProducts(List <string> NewModuleProducts)
        {
            CurrentModuleProducts.Clear();
            CurrentModuleProducts.AddRange(NewModuleProducts);

            string CombinedProducts = "";

            foreach (string CurrentProduct in NewModuleProducts)
            {
                CombinedProducts += (CombinedProducts.Length > 0 ? "," : "") + CurrentProduct;
            }

            IgorJobConfig.SetStringParam(ProductsFlag, CombinedProducts);
        }
Beispiel #2
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);
        }