Пример #1
0
        private IEnumerator SlowDownCoroutine(float time, float percent, AbstractBug bug)
        {
            bug.coroutineRunning.Add(true);
            bug.speed = bug.startSpeed * (1f - percent);
            yield return(new WaitForSeconds(time));

            bug.coroutineRunning.Add(false);

            if (bug.IsSlowedDown() == false)
            {
                bug.RestoreSpeed();
            }
        }
Пример #2
0
 private void SlowDown(float time, float percent, AbstractBug bug)
 {
     StartCoroutine(SlowDownCoroutine(time, percent, bug));
 }