示例#1
0
        private void CreateAnimationCycle()
        {
            _transform = this.GameObject.GetComponent <TransformationComponent>();

            _animationProcess = Process.BuildProcessChain(
                new TweenProcess(Easing.GetSineFunction(), _duration, interp =>
            {
                _transform.Scale = GetTweenedSwellSize(interp.Value);
            }),
                new TweenProcess(Easing.ConvertTo(EasingKind.EaseOut, Easing.GetSineFunction()), _duration, interp =>
            {
                _transform.Scale = GetTweenedSwellSize(1.0f - interp.Value);
            }),
                new ActionProcess(() =>
            {
                _transform.Scale = 1.0f;
                if (_isRepeating)
                {
                    CreateAnimationCycle();
                }
                else
                {
                    // We are done, remove self
                    this.GameObject.RemoveComponent <SwellComponent>();
                }
            }));

            this.GameObject.ProcessManager.AttachProcess(_animationProcess);
        }