Пример #1
0
    private static CoroutineHostInstance InstantiateCoroutineHost()
    {
        GameObject            coroutineHost = new GameObject("Coroutine Host");
        CoroutineHostInstance chi           = coroutineHost.AddComponent <CoroutineHostInstance>();

        GameObject.DontDestroyOnLoad(coroutineHost);
        return(chi);
    }
Пример #2
0
 /// <summary>
 /// Because we can't instantiate game objects from other thread, call this to pre-instantiate the host in the main thread first.
 /// </summary>
 public static void PrepareCrossThread()
 {
     crossThreadHost = InstantiateCoroutineHost();
 }