示例#1
0
    void Start()
    {
        state = new LuaState();
        state.Start();
        state.DoString(script);

        LuaFunction func = state.GetFunction("Test");

        func.BeginPCall();
        func.PCall();
        thread = func.CheckLuaThread();
        func.EndPCall();
        func.Dispose();
        func = null;

        thread.Resume(10);
    }
示例#2
0
    private void Start()
    {
        this.state = new LuaState();
        this.state.Start();
        this.state.LogGC = true;
        this.state.DoString(this.script, "LuaState.cs");
        LuaFunction function = this.state.GetFunction("Test", true);

        function.BeginPCall();
        function.PCall();
        this.thread      = function.CheckLuaThread();
        this.thread.name = "LuaThread";
        function.EndPCall();
        function.Dispose();
        this.thread.Resume(new object[]
        {
            10
        });
    }
示例#3
0
    void Start()
    {
        Application.logMessageReceived += ShowTips;
        new LuaResLoader();
        state = new LuaState();
        state.Start();
        state.LogGC = true;
        state.DoString(script);

        LuaFunction func = state.GetFunction("Test");

        func.BeginPCall();
        func.PCall();
        thread      = func.CheckLuaThread();
        thread.name = "LuaThread";
        func.EndPCall();
        func.Dispose();
        func = null;

        thread.Resume(10);
    }
    void Start()
    {
#if UNITY_5 || UNITY_2017 || UNITY_2018
        Application.logMessageReceived += ShowTips;
#else
        Application.RegisterLogCallback(ShowTips);
#endif
        new LuaResLoader();
        state = new LuaState();
        state.Start();
        state.LogGC = true;
        state.DoString(script);

        LuaFunction func = state.GetFunction("Test");
        func.BeginPCall();
        func.PCall();
        thread      = func.CheckLuaThread();
        thread.name = "LuaThread";
        func.EndPCall();
        func.Dispose();
        func = null;
        thread.Resume(10);
    }
    private void Start()
    {
        luaState = new LuaState();
        luaState.Start();
        luaState.LogGC = true;//显示GC回收的LOG日志


        var luaScript = Resources.Load <TextAsset>("TestLuaThread.lua");

        luaState.DoString(luaScript.text);

        LuaFunction func = luaState.GetFunction("Test");

        func.BeginPCall();
        func.PCall();
        thread      = func.CheckLuaThread();
        thread.name = "MyLuaThread";
        func.EndPCall();
        func.Dispose();
        func = null;

        thread.Resume(10);
    }