static LoadedSceneInfo TryCreateLoadedSceneInfo(Scene scene)
        {
            var sceneContext     = ZenUnityEditorUtil.TryGetSceneContextForScene(scene);
            var decoratorContext = ZenUnityEditorUtil.TryGetDecoratorContextForScene(scene);

            if (sceneContext == null && decoratorContext == null)
            {
                return(null);
            }

            var info = new LoadedSceneInfo
            {
                Scene = scene
            };

            if (sceneContext != null)
            {
                Assert.IsNull(decoratorContext,
                              "Found both SceneContext and SceneDecoratorContext in scene '{0}'", scene.name);

                info.SceneContext = sceneContext;
            }
            else
            {
                Assert.IsNotNull(decoratorContext);

                info.DecoratorContext = decoratorContext;
            }

            return(info);
        }
예제 #2
0
        public void TestFail()
        {
            _decoratorScene.GetRootGameObjects().Where(x => x.name == "Foo")
            .Single().GetComponent <ZenjectBinding>().enabled = false;

            Assert.Throws(() => ZenUnityEditorUtil.RunCurrentSceneSetup());
        }
        public IEnumerator TestValidationFail()
        {
            _decoratorScene.GetRootGameObjects().Where(x => x.name == "Foo")
            .Single().GetComponent <ZenjectBinding>().enabled = false;

            Assert.Throws(() => ZenUnityEditorUtil.ValidateCurrentSceneSetup());
            yield break;
        }
예제 #4
0
        public static void CreateReflectionBakingSettings()
        {
            var folderPath = ZenUnityEditorUtil.GetCurrentDirectoryAssetPathFromSelection();

            var config = ScriptableObject.CreateInstance <ZenjectReflectionBakingSettings>();

            ZenUnityEditorUtil.SaveScriptableObjectAsset(
                Path.Combine(folderPath, "ZenjectReflectionBakingSettings.asset"), config);
        }
예제 #5
0
        public static void TestScenesUnderneathFolder()
        {
            var allFolderPaths = ZenUnityEditorUtil.GetSelectedFolderPathsInProjectsTab().Select(relativePath =>
                                                                                                 Path.Combine(
                                                                                                     Directory.GetParent(Application.dataPath).FullName, relativePath)).ToHashSet().ToList();

            var allSceneNames = StUtil.GetAllSceneNamesUnderneathFolders(allFolderPaths);

            StWindow.Instance.RunScenes(allSceneNames, false, false);
        }
예제 #6
0
        private static int ValidateAllScenes()
        {
            var activeScenePaths = EditorBuildSettings.scenes.Where(x => x.enabled)
                                   .Select(x => x.path).ToList();

            EditorSceneManager.OpenScene(InitScenePath);
            EditorSceneManager.CloseScene(SceneManager.GetActiveScene(), true);

            foreach (var scenePath in activeScenePaths)
            {
                EditorSceneManager.OpenScene(scenePath, OpenSceneMode.Additive);
            }

            ZenUnityEditorUtil.ValidateCurrentSceneSetup();

            return(activeScenePaths.Count);
        }
 public IEnumerator TestSuccess()
 {
     ZenUnityEditorUtil.RunCurrentSceneSetup();
     yield break;
 }
 public IEnumerator TestValidationPass()
 {
     ZenUnityEditorUtil.ValidateCurrentSceneSetup();
     yield break;
 }
예제 #9
0
 public void TestSuccess()
 {
     ZenUnityEditorUtil.RunCurrentSceneSetup();
 }
예제 #10
0
 public void TestValidationPass()
 {
     ZenUnityEditorUtil.ValidateCurrentSceneSetup();
 }
예제 #11
0
 public static bool ValidateTestScenesUnderneathFolder()
 {
     return(!ZenUnityEditorUtil.GetSelectedFolderPathsInProjectsTab().IsEmpty());
 }