Первая корутина.
Синтаксис:
Используется csharp
if (GlobalValues.Tutor)
{
TutorialPanel.SetActive(true);
yield return StartCoroutine(TutorialPanel.GetComponent<TutorialPanelScript>().TutorialTossActivate());
}
Debug.Log("Корутина выполнена");
{
TutorialPanel.SetActive(true);
yield return StartCoroutine(TutorialPanel.GetComponent<TutorialPanelScript>().TutorialTossActivate());
}
Debug.Log("Корутина выполнена");
Вторая корутина
Синтаксис:
Используется csharp
public IEnumerator TutorialTossActivate()
{
Debug.Log("Ждём Активации Тутора");
TutWindowActivated = true;
yield return new WaitForSeconds(0.2f);
Debug.Log("TutWindowActivated=" + TutWindowActivated);
if (!TutTossShowed)
{
Debug.Log("Тутор1Активен");
Open = true;
Close = false;
TutTossShowed = true;
}
yield return new WaitForSeconds(0.5f);
yield return new WaitUntil(() => Input.GetMouseButtonDown(0));
Open = false;
Close = true;
TutWindowActivated = false;
if (GlobalValues.Players[GlobalValues.CurrentPlayerID].GetComponent<PlayerScript>().Bot == true)
{
GlobalValues.Players[GlobalValues.CurrentPlayerID].GetComponent<BotScript>().BotReady = true;
}
Debug.Log("Конец тутор корутины");
}
{
Debug.Log("Ждём Активации Тутора");
TutWindowActivated = true;
yield return new WaitForSeconds(0.2f);
Debug.Log("TutWindowActivated=" + TutWindowActivated);
if (!TutTossShowed)
{
Debug.Log("Тутор1Активен");
Open = true;
Close = false;
TutTossShowed = true;
}
yield return new WaitForSeconds(0.5f);
yield return new WaitUntil(() => Input.GetMouseButtonDown(0));
Open = false;
Close = true;
TutWindowActivated = false;
if (GlobalValues.Players[GlobalValues.CurrentPlayerID].GetComponent<PlayerScript>().Bot == true)
{
GlobalValues.Players[GlobalValues.CurrentPlayerID].GetComponent<BotScript>().BotReady = true;
}
Debug.Log("Конец тутор корутины");
}
Вот что выводит консоль.
И всё. Не вижу Debug.Log("Корутина выполнена");