void Generate()
{
StartCoroutine(FallDelayCoroutine());
print(\"time3- \" + Time.time);
}
IEnumerator FallDelayCoroutine()
{
print(\"time1- \"+ Time.ti
As alternative to the other answer using two Coroutines you could also add a callback like e.g.
IEnumerator FallDelayCoroutine(Action whenDone)
{
print("time1- "+ Time.time);
yield return new WaitForSeconds(3f);
print("time2- " + Time.time);
whenDone?.Invoke();
}
and call it either using e.g. a lambda expression
void Generate()
{
StartCoroutine(FallDelayCoroutine(() => {
print("time3- " + Time.time);
}));
}
or with a method
void Generate()
{
StartCoroutine(FallDelayCoroutine(OnFallDelayDone));
}
private void OnFallDelayDone()
{
print("time3- " + Time.time);
}