Example #1
0
        IEnumerator TestUtilities()
        {
            for (int i = 0; i < 3; ++i)
            {
                yield return(null);

                Debug.Log("TestUtilities: yield null");
            }

            Debug.Log("time scale: " + Time.timeScale);
            for (int i = 0; i < 3; ++i)
            {
                yield return(CoexWaitForSeconds.New(1f));

                Debug.Log(string.Format("TestUtilities: {0} => yield WaitForSeconds", Time.unscaledTime));
            }

            Time.timeScale = 0.5f;
            Debug.Log("time scale: " + Time.timeScale);
            CoexWaitForSeconds wait = CoexWaitForSeconds.New(1f);

            for (int i = 0; i < 3; ++i)
            {
                yield return(wait);

                Debug.Log(string.Format("TestUtilities: {0} => yield WaitForSeconds", Time.unscaledTime));
            }

            Time.timeScale = 0f;
            Debug.Log("time scale: " + Time.timeScale);
            wait = CoexWaitForSeconds.New(1f, true);
            for (int i = 0; i < 3; ++i)
            {
                yield return(wait);

                Debug.Log(string.Format("TestUtilities: {0} => yield WaitForSeconds", Time.unscaledTime));
            }

            for (int i = 0; i < 3; ++i)
            {
                yield return(CoexWaitForEndOfFrame.New());

                Debug.Log("TestUtilities: yield WaitForEndOfFrame");
            }

            Time.timeScale = 1f;
            for (int i = 0; i < 3; ++i)
            {
                yield return(CoexWaitForFixedUpdate.New());

                Debug.Log("TestUtilities: yield WaitForFixedUpdate");
            }

            string url = string.Format("file:///{0}/Coex/Tests/WWW.html", Application.dataPath);
            WWW    www = new WWW(url);

            yield return(www);

            Assert(www.isDone);
        }
Example #2
0
        static IEnumerator Routine()
        {
            yield return(CoexWaitForFixedUpdate.New());

            yield return(null);

            yield return(CoexWaitForEndOfFrame.New());

            while (true)
            {
                yield return(null);
            }
        }