void SaveCameraState(SceneView sceneView, Stage stage)
        {
            if (stage == null)
            {
                return;
            }

            // Allows stage to override which stage should be used for saving the state.
            // Useful for Prefab Mode in Context where we want to save the context scene state.
            Stage contextStage = stage.GetContextStage();

            if (contextStage == null)
            {
                return;
            }

            Hash128 key   = StageUtility.CreateWindowAndStageIdentifier(sceneView.windowGUID, contextStage);
            var     state = m_StateCache.GetState(key);

            if (state == null)
            {
                state = new SceneViewCameraState();
            }
            state.SaveStateFromSceneView(sceneView);
            m_StateCache.SetState(key, state);
        }
Exemplo n.º 2
0
        void SaveHierarchyState(SceneHierarchyWindow hierarchyWindow, StageNavigationItem stage)
        {
            if (stage == null)
            {
                return;
            }
            string key   = StageUtility.CreateWindowAndStageIdentifier(hierarchyWindow.windowGUID, stage);
            var    state = m_StateCache.GetState(key);

            if (state == null)
            {
                state = new SceneHierarchyState();
            }
            state.SaveStateFromHierarchy(hierarchyWindow, stage);
            m_StateCache.SetState(key, state);
        }
Exemplo n.º 3
0
        void SaveCameraState(SceneView sceneView, StageNavigationItem stage)
        {
            if (stage == null)
            {
                return;
            }
            string key   = StageUtility.CreateWindowAndStageIdentifier(sceneView.windowGUID, stage);
            var    state = m_StateCache.GetState <SceneViewCameraState>(key);

            if (state == null)
            {
                state = new SceneViewCameraState();
            }
            state.SaveStateFromSceneView(sceneView);
            m_StateCache.SetState(key, state);
        }
        SceneViewCameraState GetStoredCameraState(SceneView sceneView, Stage stage)
        {
            Hash128 key = StageUtility.CreateWindowAndStageIdentifier(sceneView.windowGUID, stage);

            return(m_StateCache.GetState(key));
        }
Exemplo n.º 5
0
        SceneHierarchyState GetStoredHierarchyState(SceneHierarchyWindow hierarchyWindow, StageNavigationItem stage)
        {
            string key = StageUtility.CreateWindowAndStageIdentifier(hierarchyWindow.windowGUID, stage);

            return(m_StateCache.GetState(key));
        }
Exemplo n.º 6
0
        SceneViewCameraState GetStoredCameraState(SceneView sceneView, StageNavigationItem stage)
        {
            string key = StageUtility.CreateWindowAndStageIdentifier(sceneView.windowGUID, stage);

            return(m_StateCache.GetState <SceneViewCameraState>(key));
        }