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 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);
        }