Код: Выделить всё
private IEnumerator ReversePlatform()
{
yield return new WaitForSeconds(2);
_AccuTime = 0;
speed = -speed;
}
Код: Выделить всё
if (_AccuTime > _RunTime)
{
StartCoroutine("ReversePlatform");
}
else
{
transform.Translate(0, speed * Time.deltaTime, 0);
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... orks-wrong