Beispiel #1
0
        public static void DrawDopeSheet(IAnimatableData animatable, IKeyable keyable, Rect rect, float startTime, float length, bool highlightRange = true)
        {
            DopeSheetRenderer dopeSheet = null;

            if (!cache.TryGetValue(animatable, out dopeSheet))
            {
                cache[animatable] = dopeSheet = new DopeSheetRenderer(animatable, keyable);
            }
            dopeSheet.DrawDopeSheet(animatable, keyable, rect, startTime, length, highlightRange);
        }
Beispiel #2
0
        //Refresh dopesheet keys of target animatable.
        static void RefreshDopeKeysOf(IAnimatableData animatable)
        {
            DopeSheetRenderer dopeSheet = null;

            if (cache.TryGetValue(animatable, out dopeSheet))
            {
                dopeSheet.RefreshDopeKeys(animatable);
            }

            if (animatable is AnimationDataCollection)
            {
                var data = (AnimationDataCollection)animatable;
                if (data.animatedParameters != null)
                {
                    foreach (var animParam in data.animatedParameters)
                    {
                        if (cache.TryGetValue(animParam, out dopeSheet))
                        {
                            dopeSheet.RefreshDopeKeys(animParam);
                        }
                    }
                }
            }

            if (animatable is AnimatedParameter)
            {
                foreach (var pair in cache)
                {
                    if (pair.Key is AnimationDataCollection)
                    {
                        var data = (AnimationDataCollection)pair.Key;
                        if (data.animatedParameters != null && data.animatedParameters.Contains((AnimatedParameter)animatable))
                        {
                            pair.Value.RefreshDopeKeys(pair.Key);
                            break;
                        }
                    }
                }
            }
        }