Пример #1
0
        public bool OpenCache(string path)
        {
            CloseCache();
            m_openRequested = false;

            m_sceneCache = SceneCacheData.Open(path);
            if (m_sceneCache)
            {
#if UNITY_EDITOR
                this.sortEntities = true;
#endif
                m_cacheFilePath.fullPath = path;
                m_pathPrev  = path;
                m_timeRange = m_sceneCache.timeRange;
                if (m_logging)
                {
                    Debug.Log(string.Format("SceneCachePlayer: cache opened ({0})", path));
                }
                return(true);
            }
            else
            {
                if (m_logging)
                {
                    Debug.Log(string.Format("SceneCachePlayer: cache open failed ({0})", path));
                }
                return(false);
            }
        }
Пример #2
0
//----------------------------------------------------------------------------------------------------------------------

        private bool OpenCacheInternal(string path, bool updateNonMaterialAssets)
        {
            CloseCache();

            m_sceneCache = SceneCacheData.Open(path);
            if (!m_sceneCache)
            {
                Debug.LogError($"SceneCachePlayer: cache open failed ({path})");
                return(false);
            }

            m_sceneCacheFilePath = path;

            UpdateSceneCacheInfo(m_sceneCacheInfo, m_sceneCache);

#if UNITY_EDITOR
            SetSortEntities(true);
#endif
            LogDebug($"SceneCachePlayer: cache opened ({path})");

            //[Note-sin: 2021-7-19] Time/Frame 0 must be loaded first, because the data of other frames might contain "No change from frame 0"
            LoadSceneCacheToScene(0, updateNonMaterialAssets);

            return(true);
        }
Пример #3
0
        internal ISceneCacheInfo ExtractSceneCacheInfo(bool forceOpen)
        {
            if (IsSceneCacheOpened())
            {
                return(m_sceneCacheInfo);
            }

            if (!forceOpen)
            {
                return(null);
            }

            SceneCacheData tempSceneCache = SceneCacheData.Open(m_sceneCacheFilePath);

            if (!tempSceneCache)
            {
                return(null);
            }

            SceneCacheInfo ret = new SceneCacheInfo();

            UpdateSceneCacheInfo(ret, tempSceneCache);
            tempSceneCache.Close();

            return(ret);
        }
Пример #4
0
        private static void UpdateSceneCacheInfo(SceneCacheInfo scInfo, SceneCacheData scData)
        {
            Assert.IsTrue(scData);

            scInfo.numFrames  = scData.GetNumScenes();
            scInfo.sampleRate = scData.GetSampleRate();
            scInfo.timeCurve  = scData.GetTimeCurve(InterpolationMode.Constant);
            scInfo.timeRange  = scData.GetTimeRange();
        }
Пример #5
0
        private bool OpenCacheInternal(string path)
        {
            CloseCache();

            m_sceneCache = SceneCacheData.Open(path);
            if (!m_sceneCache)
            {
                Log($"SceneCachePlayer: cache open failed ({path})", LogType.ERROR);
                return(false);
            }

#if UNITY_EDITOR
            SetSortEntities(true);
#endif
            Log($"SceneCachePlayer: cache opened ({path})", LogType.DEBUG);
            return(true);
        }