コード例 #1
0
        void LoadSceneCacheToScene(float time, bool updateNonMaterialAssets)
        {
            m_timePrev = m_time = time;
            m_sceneCache.preloadLength = m_preloadLength;
#if UNITY_EDITOR
            ulong sceneGetBegin = Misc.GetTimeNS();
#endif
            // get scene
            SceneData scene = m_sceneCache.GetSceneByTime(m_time, m_interpolation);
#if UNITY_EDITOR
            m_dbgSceneGetTime = Misc.NS2MS(Misc.GetTimeNS() - sceneGetBegin);
#endif

            if (scene)
            {
#if UNITY_EDITOR
                ulong sceneUpdateBegin = Misc.GetTimeNS();
#endif
                // update scene
                this.BeforeUpdateScene();
                this.UpdateScene(scene, updateNonMaterialAssets);
                this.AfterUpdateScene();
#if UNITY_EDITOR
                SetSortEntities(false);

                if (m_config.Profiling)
                {
                    m_dbgSceneUpdateTime = Misc.NS2MS(Misc.GetTimeNS() - sceneUpdateBegin);
                    UpdateProfileReport(scene);
                }
#endif
            }
        }
コード例 #2
0
        public void UpdatePlayer()
        {
            if (m_openRequested)
            {
                OpenCache(m_cacheFilePath.fullPath);
            }

            if (m_timeUnit == TimeUnit.Frames)
            {
                int offset = (int)m_baseFrame;
                m_frame = Mathf.Clamp(m_frame, offset, frameCount + offset);
                m_time  = m_sceneCache.GetTime(m_frame - offset);
            }

            if (m_sceneCache)
            {
                if (m_time != m_timePrev)
                {
                    m_timePrev = m_time;
                    m_sceneCache.preloadLength = m_preloadLength;
#if UNITY_EDITOR
                    ulong sceneGetBegin = Misc.GetTimeNS();
#endif
                    // get scene
                    var scene = m_sceneCache.GetSceneByTime(m_time, m_interpolation);
#if UNITY_EDITOR
                    m_dbgSceneGetTime = Misc.NS2MS(Misc.GetTimeNS() - sceneGetBegin);
#endif

                    if (scene)
                    {
#if UNITY_EDITOR
                        ulong sceneUpdateBegin = Misc.GetTimeNS();
#endif
                        // update scene
                        this.BeforeUpdateScene();
                        this.UpdateScene(scene);
                        this.AfterUpdateScene();
#if UNITY_EDITOR
                        this.sortEntities = false;

                        if (m_config.Profiling)
                        {
                            m_dbgSceneUpdateTime = Misc.NS2MS(Misc.GetTimeNS() - sceneUpdateBegin);
                            UpdateProfileReport(scene);
                        }
#endif
                    }
                }
                else if (m_sceneCache.preloadLength != m_preloadLength)
                {
                    m_sceneCache.preloadLength = m_preloadLength;
                    m_sceneCache.Preload(m_sceneCache.GetFrame(m_time));
                }
            }
        }
コード例 #3
0
        private void UpdatePlayer(bool updateNonMaterialAssets)
        {
            if (m_timeUnit == TimeUnit.Frames)
            {
                int offset = (int)m_baseFrame;
                m_frame = Mathf.Clamp(m_frame, offset, frameCount + offset);
                m_time  = m_sceneCache.GetTime(m_frame - offset);
            }

            if (!m_sceneCache)
            {
                return;
            }

            if (m_time != m_timePrev)
            {
                m_timePrev = m_time;
                m_sceneCache.preloadLength = m_preloadLength;
#if UNITY_EDITOR
                ulong sceneGetBegin = Misc.GetTimeNS();
#endif
                // get scene
                SceneData scene = m_sceneCache.GetSceneByTime(m_time, m_interpolation);
#if UNITY_EDITOR
                m_dbgSceneGetTime = Misc.NS2MS(Misc.GetTimeNS() - sceneGetBegin);
#endif

                if (scene)
                {
#if UNITY_EDITOR
                    ulong sceneUpdateBegin = Misc.GetTimeNS();
#endif
                    // update scene
                    this.BeforeUpdateScene();
                    this.UpdateScene(scene, updateNonMaterialAssets);
                    this.AfterUpdateScene();
#if UNITY_EDITOR
                    SetSortEntities(false);

                    if (m_config.Profiling)
                    {
                        m_dbgSceneUpdateTime = Misc.NS2MS(Misc.GetTimeNS() - sceneUpdateBegin);
                        UpdateProfileReport(scene);
                    }
#endif
                }
            }
            else if (m_sceneCache.preloadLength != m_preloadLength)
            {
                m_sceneCache.preloadLength = m_preloadLength;
                m_sceneCache.Preload(m_sceneCache.GetFrame(m_time));
            }
        }
コード例 #4
0
        void LoadSceneCacheToScene(float time, bool updateNonMaterialAssets)
        {
            m_sceneCache.SetPreloadLength(m_preloadLength);
#if UNITY_EDITOR
            ulong sceneGetBegin = Misc.GetTimeNS();
#endif

            SceneData scene = LoadSceneData(time, out m_frame);
            m_loadedTime = time;

            // get scene
#if UNITY_EDITOR
            m_dbgSceneGetTime = Misc.NS2MS(Misc.GetTimeNS() - sceneGetBegin);
#endif

            if (scene)
            {
#if UNITY_EDITOR
                ulong sceneUpdateBegin = Misc.GetTimeNS();
#endif

                // update scene
                this.BeforeUpdateScene();
                this.UpdateScene(scene, updateNonMaterialAssets);
                this.AfterUpdateScene();
#if UNITY_EDITOR
                SetSortEntities(false);

                if (m_config.Profiling)
                {
                    m_dbgSceneUpdateTime = Misc.NS2MS(Misc.GetTimeNS() - sceneUpdateBegin);
                    UpdateProfileReport(scene);
                }
#endif
            }
        }