LuaInterface.LuaState.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
		public void Start() {}
		public object[] DoFile (string fileName) { return null;}

Usage Example

コード例 #1
0
    void Start()
    {
        LuaState lua = new LuaState();
        lua.Start();
        lua.DoString(script);

        string[] strs = { "aaa", "bbb", "ccc" };
        LuaFunction func = lua.GetFunction("TestArray");

        func.BeginPCall();
        func.Push(strs);
        func.PCall();
        double arg1 = func.CheckNumber();
        string arg2 = func.CheckString();
        bool arg3 = func.CheckBoolean();
        Debugger.Log("return is {0} {1} {2}", arg1, arg2, arg3);
        func.EndPCall();

        //转换一下类型,避免可变参数拆成多个参数传递
        object[] objs = func.Call((object)strs);

        if (objs != null)
        {
            Debugger.Log("return is {0} {1} {2}", objs[0], objs[1], objs[2]);
        }

        lua.CheckTop();
        func.Dispose();
        lua.Dispose();
    }
All Usage Examples Of LuaInterface.LuaState::Start