예제 #1
0
        private void UpdateFromAnimation(Transform p_target, float p_time)
        {
            // If we are in reverse we need to go back in time
            if (Model.isReverse)
            {
                p_time = Model.source.Duration - p_time;
            }

            // Apply from cache and prestored animation curves
            AnimationSampler.ApplyFromCurves(p_target, _startsCaches[p_target], Model.source, p_time,
                                             Model.isRelative);
        }
예제 #2
0
        private void CacheStarts(Transform p_target)
        {
            // Generate starts cache
            AnimationStartsCache cache =
                AnimationSampler.CacheStarts(p_target, Model.source, Model.isReverse, Model.source.Duration);

            // Create cache if it doesn't exist
            if (_startsCaches == null)
            {
                _startsCaches = new Dictionary <Transform, AnimationStartsCache>();
            }

            // Store animation cache for this target
            _startsCaches[p_target] = cache;
        }