コード例 #1
0
        public void Play(string animationId)
        {
#if DEBUG
            if (DebugMode)
            {
                Debug.Log("CursorAnimator.Play: " + animationId);
            }
#endif
            _animator.Play(animationId);

            if (null != animationId)
            //if (string.IsNullOrEmpty(animationId))
            {
                // subscribe
                SystemEventDispatcher.Instance.AddEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);

                // hide system cursor
                //Screen.showCursor = false;

                // show custom cursor
                //_stage.Visible = true;

                ShowCurrentTexture();
            }
            else
            {
                Stop();
            }
        }
コード例 #2
0
        public void Play_OnFrameChanged_RandomStart()
        {
            var _startingFrames = new List <int>();

            _clip.RandomStart.Returns(true);
            for (var i = 0; i < 100; i++)
            {
                var animator = new FrameAnimator(new IClip[] { _clip });
                animator.OnFrameChanged += (index) =>
                {
                    _startingFrames.Add(index);
                };
                animator.Play(_clip);
            }
            var distinctCount = _startingFrames.Distinct().Count();

            Assert.That(distinctCount, Is.GreaterThan(1));
        }