Exemplo n.º 1
0
        public KeyFrameCursor CreateCursor()
        {
            var cursor = new KeyFrameCursor(this);

            _cursors.Add(cursor);
            return(cursor);
        }
Exemplo n.º 2
0
        public SecuenceNode Playing(KeyFrameAnimation animation, KeyFrameCursor cursor = null, float blend = 1.0f)
        {
            KeyFramePlaybackDesc b = new KeyFramePlaybackDesc(animation, cursor, blend);

            _animations.Add(b);
            return(this);
        }
        public KeyFrameAnimationPlayback AddAnimation(KeyFrameAnimation animation, KeyFrameCursor cursor = null, float blend = 1.0f, float velocity = 1.0f)
        {
            var desc = new KeyFramePlaybackDesc(animation, cursor, blend, velocity);

            _animations.AddLast(desc);
            return(this);
        }
 public KeyFramePlaybackDesc(KeyFrameAnimation animation, KeyFrameCursor cursor = null, float blend = 1.0f, float velocity = 1.0f)
 {
     this.Animation = animation;
     this.Cursor    = cursor ?? animation.GetCursor(0);
     this.Blend     = blend;
     this.Velocity  = velocity;
 }
Exemplo n.º 5
0
        public SecuenceNode Playing(KeyFrameAnimation animation, float startTime, float duration, AnimationLooping loop, float blend = 1.0f)
        {
            KeyFrameCursor cursor = new KeyFrameCursor(animation)
            {
                StartTime = startTime,
                EndTime   = startTime + duration,
                Looping   = loop
            };
            KeyFramePlaybackDesc b = new KeyFramePlaybackDesc(animation, cursor, blend);

            _animations.Add(b);
            return(this);
        }
        public KeyFrameAnimationPlayback AddAnimation(KeyFrameAnimation animation, float startTime, float duration, AnimationLooping loop, float blend = 1.0f, float velocity = 1.0f)
        {
            KeyFrameCursor cursor = new KeyFrameCursor(animation)
            {
                StartTime = startTime,
                EndTime   = startTime + duration,
                Looping   = loop
            };
            KeyFramePlaybackDesc b = new KeyFramePlaybackDesc(animation, cursor, blend, velocity);

            _animations.AddLast(b);
            return(this);
        }
Exemplo n.º 7
0
        public KeyFrameAnimation(string name)
            : base(name, null)
        {
            //Creates the Defaul cursor
            _cursors.Add(KeyFrameCursor.Create(this));

            _nodes = new ObservedDictionary <string, CurvesContainer>(
                itemAdded: x =>
            {
                x.Animation = this;
            },
                itemRemoved: x =>
            {
                if (x.Animation == this)
                {
                    x.Animation = null;
                }
            },
                keySelector: x => x.Name);
        }
Exemplo n.º 8
0
 public void Update(float elapsedTime, KeyFrameCursor state, float blendWeight = 1.0f, bool blended = false)
 {
     state.ValidateTime();
     Sample(state.Time, blendWeight, blended);
     state.UpdateTime(elapsedTime);
 }
 public KeyFrameAnimationPlayback(KeyFrameAnimation animation, KeyFrameCursor cursor = null, float blend = 1.0f, float velocity = 1.0f)
 {
     AddAnimation(animation, cursor, blend, velocity);
 }