コード例 #1
0
ファイル: WrapFSMBase.cs プロジェクト: liangxc2014/Sanguoqy02
    static int GetComponent(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        Type[] types0 = { typeof(FSMBase), typeof(string) };
        Type[] types1 = { typeof(FSMBase), typeof(Type) };

        if (count == 2 && LuaScriptMgr.CheckTypes(L, types0, 1))
        {
            FSMBase   obj  = LuaScriptMgr.GetNetObject <FSMBase>(L, 1);
            string    arg0 = LuaScriptMgr.GetString(L, 2);
            Component o    = obj.GetComponent(arg0);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, types1, 1))
        {
            FSMBase   obj  = LuaScriptMgr.GetNetObject <FSMBase>(L, 1);
            Type      arg0 = LuaScriptMgr.GetTypeObject(L, 2);
            Component o    = obj.GetComponent(arg0);
            LuaScriptMgr.Push(L, o);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: FSMBase.GetComponent");
        }

        return(0);
    }