Gra Unity Sleep on Hit

public void StartSleep(float duration)
{
  StartCoroutine(HitSleep(duration));
}

IEnumerator HitSleep(float duration)
{
  Time.timescale = 0;
  yield return new WaitForSecondsRealtime(duration);
  Time.timescale = 1;
}
TebionDL