Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        private static int CalculateFrameByRound(float time, SceneCacheInfo scInfo, LimitedAnimationController controller)
        {
            int frame = Mathf.RoundToInt(time * scInfo.sampleRate);

            frame = controller.Apply(frame);
            frame = Mathf.Clamp(frame, 0, scInfo.numFrames - 1);
            return(frame);
        }
Exemplo n.º 3
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();
        }