Esempio n. 1
0
        IEnumerator _testEvent1(int i, CothreadEvent ev, CothreadEvent nev)
        {
            yield return(ev.Wait(0));

            var result = (string)ev.Get("");
            var msg    = string.Format("{0} {1} ->", result, i.ToString());

            if (nev != null)
            {
                nev.Set(msg);
            }
            else
            {
                CothreadHub.Log("result: " + msg);
            }
        }
Esempio n. 2
0
        IEnumerator testEvent2()
        {
            var ev = new CothreadEvent();

            hub.StartCoroutine(_testEvent2(ev));
            yield return(ev.Wait());

            if (!ev.Get().Equals(1))
            {
                CothreadHub.Log("[testEvent2] error");
            }
            else
            {
                CothreadHub.Log("[testEvent2] ok");
            }
            ev.Clear();
            hub.StartCoroutine(_testEvent2(ev));
            yield return(ev);

            AssertDebug.Assert(ev.Get().Equals(1), "[testEvent2] yield event error!");
        }