Exemplo n.º 1
0
    public static void RestoreSceneSetup()
    {
        var assetPath = PathsUtility.ConvertFullAbsolutePathToAssetPath(PathsUtility.TryGetSelectedFilePathInProjectsTab());
        var loader    = AssetDatabase.LoadAssetAtPath <MultiSceneSetup>(assetPath);
        var setups    = new UnityEditor.SceneManagement.SceneSetup[loader.Setups.Count];

        for (var i = 0; i < loader.Setups.Count; i++)
        {
            setups[i]          = new UnityEditor.SceneManagement.SceneSetup();
            setups[i].isActive = loader.Setups[i].IsActive;
            setups[i].isLoaded = loader.Setups[i].IsLoaded;
            setups[i].path     = loader.Setups[i].Path;
        }

        EditorSceneManager.RestoreSceneManagerSetup(setups);
    }
Exemplo n.º 2
0
    public static void SaveSceneSetup()
    {
        var assetPath = PathsUtility.ConvertFullAbsolutePathToAssetPath(PathsUtility.TryGetSelectedFilePathInProjectsTab());

        SaveCurrentSceneSetup(assetPath);
    }