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); }
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; }
public static void CreateReflectionBakingSettings() { var folderPath = ZenUnityEditorUtil.GetCurrentDirectoryAssetPathFromSelection(); var config = ScriptableObject.CreateInstance <ZenjectReflectionBakingSettings>(); ZenUnityEditorUtil.SaveScriptableObjectAsset( Path.Combine(folderPath, "ZenjectReflectionBakingSettings.asset"), config); }
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); }
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; }
public void TestSuccess() { ZenUnityEditorUtil.RunCurrentSceneSetup(); }
public void TestValidationPass() { ZenUnityEditorUtil.ValidateCurrentSceneSetup(); }
public static bool ValidateTestScenesUnderneathFolder() { return(!ZenUnityEditorUtil.GetSelectedFolderPathsInProjectsTab().IsEmpty()); }