예제 #1
0
        void Update()
        {
            if (_isUpdate)
            {
                Boost boost = _boosts.Find(x => x.timing == _updateFrame);
                if (boost != null)
                {
                    Accelerator(boost.value);
                }
                else
                {
                    Accelerator(1f);
                }

                _updateFrame++;
                _time += Time.deltaTime;

                _easyAnimation.SetSpeed(_rigidbody.velocity.magnitude * 0.3f);
            }
        }
예제 #2
0
 void Update()
 {
     if (_isRunning)
     {
         if (_rigidbody.velocity.magnitude < 0.5)
         {
             _easyAnimation.CrossFade(0, 0, 1);
             _isRunning = false;
             _easyAnimation.SetSpeed(1f);
         }
     }
     else
     {
         if (_rigidbody.velocity.magnitude < 0.5)
         {
             _easyAnimation.SetSpeed(1);
         }
         else
         {
             _easyAnimation.SetSpeed(_rigidbody.velocity.magnitude * 3f);
         }
     }
 }
예제 #3
0
        public void Play(string stateName)
        {
            if (_easyAnimation == null)
            {
                return;
            }

            _easyAnimation.SetSpeed(_speed);
            _easyAnimation.Play(stateName, 0);
            var state = _easyAnimation.GetState(stateName);

            if (!state.Clip.isLooping)
            {
                _playAnimationStateName = stateName;
            }
            else
            {
                _playAnimationStateName = null;
            }
        }