Exemplo n.º 1
0
 /// <inheritdoc />
 public void Dispose()
 {
     OnClipComplete = null;
     OnTrigger      = null;
     _frameAnimator.Dispose();
     _frameAnimator = null;
 }
Exemplo n.º 2
0
        public void SetupTests()
        {
            _clip = Substitute.For <IClip>();
            _clip.FrameRate.Returns(1f);
            _clip.Name.Returns("clip");
            _clip.FrameCount.Returns(3);
            var frame0 = CreateFrame(1, 1f);

            _clip[0].Returns(frame0);
            var frame1 = CreateFrame(2, 0.5f, "trigger");

            _clip[1].Returns(frame1);
            var frame2 = CreateFrame(3, 1f);

            _clip[2].Returns(frame2);

            _animator = new FrameAnimator(new IClip[] { _clip });

            _lastIndex                = -1;
            _onFrameChangedCount      = 0;
            _animator.OnFrameChanged += (frame) =>
            {
                _lastIndex = frame;
                _onFrameChangedCount++;
            };

            _onCompleteCount          = 0;
            _animator.OnClipComplete += () => _onCompleteCount++;

            _onTriggerCount      = 0;
            _lastTrigger         = string.Empty;
            _animator.OnTrigger += triggerName =>
            {
                _lastTrigger = triggerName;
                _onTriggerCount++;
            };
        }
Exemplo n.º 3
0
 void Awake()
 {
     _frameAnimator = new FrameAnimator(_clips, _childMode);
     Init();
 }