Exemplo n.º 1
0
    private IEnumerator DelegateCoroutine(LoadCoroutine del)
    {
        while (true)
        {
            yield return(new WaitForEndOfFrame());

            if (!del())
            {
                break;
            }
        }
    }
Exemplo n.º 2
0
    public void CallDelegateOnNextFrame(LoadCoroutine del)
    {
        if (pMainThreadId == Thread.CurrentThread.ManagedThreadId)
        {
            bool dFirst = del();
            if (dFirst)
            {
                StartCoroutine(DelegateCoroutine(del));
            }
            return;
        }

        lock (pDelegates)
            pDelegates.Add(del);
    }