Example #1
0
    /// <summary>
    /// Moves the selected level into the top position making it the first level.
    /// </summary>
    private void MoveToFirst()
    {
        BeforeChange("Move level to first position");
        IList <string> selectedLevels = levelListData.GetSelectedItems(Target.levels);

        SMSceneConfigurationOperation.Build(Target).MoveLevelToTop(selectedLevels).Apply(Target);
        levelListData.SetSelectedItems(Target.levels, selectedLevels);
        EditorUtility.SetDirty(Target);
    }
Example #2
0
    private void ChangeToScreen()                                // 标记成场景
    {
        BeforeChange("Change scenes to screen");
        IList <string> selectedScenes = sceneListData.GetSelectedItems(scenes);

        SMSceneConfigurationOperation.Build(Target).Screen(selectedScenes).Apply(Target);
        levelListData.ClearSelection();
        SyncBuildSettingsIfRequired();
        EditorUtility.SetDirty(Target);
    }
Example #3
0
    private void ChangeToIgnore()
    {
        BeforeChange("Change scenes to ignore");
        IList <string> selectedScenes = sceneListData.GetSelectedItems(scenes);

        SMGroupedSceneConfigurationOperation.Build(Target).Ignore(selectedScenes).Apply(Target);
        levelListData.ClearSelection();
        SyncBuildSettingsIfRequired();
        EditorUtility.SetDirty(Target);
    }
Example #4
0
    protected void OpenScene(CUListData sceneListData)            // 打开这个场景
    {
        IList <string> selectedScenes = sceneListData.GetSelectedItems(scenes);

        if (selectedScenes.Count != 1)
        {
            return;
        }
        string sceneName = selectedScenes[0];

        if (sceneLookup.ContainsKey(sceneName))
        {
            string assetPath    = sceneLookup[sceneName];
            Scene  currentScene = SceneManager.GetActiveScene(); // 当前场景

            if (currentScene.path.Equals(assetPath.Replace('\\', '/')))
            {
                MyLog.Green("当前就是这个场景,打开什么");
                return;
            }
            EditorSceneManager.SaveScene(currentScene);
            EditorSceneManager.OpenScene(assetPath);
        }
    }