コード例 #1
0
ファイル: TestLuaThread.cs プロジェクト: zhangzpap/tolua
 void OnGUI()
 {
     if (GUI.Button(new Rect(10, 10, 120, 40), "Resume Thead"))
     {
         if (thread != null && thread.Resume(true) == (int)LuaThreadStatus.LUA_YIELD)
         {
             object[] objs = thread.GetResult();
             Debugger.Log("lua yield: " + objs[0]);
         }
     }
     else if (GUI.Button(new Rect(10, 60, 120, 40), "Close Thread"))
     {
         if (thread != null)
         {
             thread.Dispose();
             thread = null;
         }
     }
 }
コード例 #2
0
    void OnGUI()
    {
        GUI.Label(new Rect(Screen.width / 2 - 300, Screen.height / 2 - 200, 600, 400), tips);

        if (GUI.Button(new Rect(10, 50, 120, 40), "Resume Thead"))
        {
            if (thread != null && thread.Resume(true) == (int)LuaThreadStatus.LUA_YIELD)
            {
                object[] objs = thread.GetResult();
                Debugger.Log("lua yield: " + objs[0]);
            }
        }
        else if (GUI.Button(new Rect(10, 150, 120, 40), "Close Thread"))
        {
            if (thread != null)
            {
                thread.Dispose();
                thread = null;
            }
        }
    }