Home > other >  Unity for ctrip after another ctrip, want to take parameters
Unity for ctrip after another ctrip, want to take parameters

Time:11-07

Process is that the loading map data showed that the loading progress, when loaded with a ctrip can show the progress bar, read after load the default data, then use a ctrip loaded to show progress

Public IEnumerator LoadMapIE (string LoadName)
{
Yield return StartCoroutine (LoadMap (LoadName));
Yield return StartCoroutine (" initializationCity ");
}

But here StartCoroutine can only use a string, so can't transfer parameters

CodePudding user response:

As a string execution coroutines can also put the parameter
 
IEnumerator MainCoro ()
{
The yield return StartCoroutine (" BranchCoro ", "111");
}

IEnumerator BranchCoro (string STR)
{
Yield return 0;
The Debug Log (STR);
}

CodePudding user response:

Public IEnumerator LoadMapIE (string LoadName)
{
Yield return StartCoroutine (" LoadMap, "LoadName); This sentence does not perform//
Yield return StartCoroutine (" initializationCity ");
}
  • Related