private static int Clear(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            EntityCreate entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            entityCreate.Clear();
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    private static int AddNpc(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 2);
            EntityCreate   entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            S2c_aoi_addnpc cmd          = (S2c_aoi_addnpc)ToLua.CheckObject(L, 2, typeof(S2c_aoi_addnpc));
            entityCreate.AddNpc(cmd);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    private static int RemoveEntityCreateEventListener(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 2);
            EntityCreate entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            string       name         = ToLua.CheckString(L, 2);
            entityCreate.RemoveEntityCreateEventListener(name);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    private static int CreateXunLuoNpcs(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 2);
            EntityCreate entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            LuaTable     table        = ToLua.CheckLuaTable(L, 2);
            entityCreate.CreateXunLuoNpcs(table);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    private static int get__mainRole(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            EntityCreate entityCreate = (EntityCreate)obj;
            SceneEntity  mainRole     = entityCreate._mainRole;
            ToLua.Push(L, mainRole);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index _mainRole on a nil value");
        }
        return(result);
    }
    private static int CreateLingqi(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 3);
            EntityCreate entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            SceneEntity  playerObj    = (SceneEntity)ToLua.CheckUnityObject(L, 2, typeof(SceneEntity));
            string       lingqiStr    = ToLua.CheckString(L, 3);
            entityCreate.CreateLingqi(playerObj, lingqiStr);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    private static int set_positionSync(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            EntityCreate entityCreate = (EntityCreate)obj;
            PositionSync positionSync = (PositionSync)ToLua.CheckUnityObject(L, 2, typeof(PositionSync));
            entityCreate.positionSync = positionSync;
            result = 0;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index positionSync on a nil value");
        }
        return(result);
    }
    private static int CreateBeauty(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 3);
            EntityCreate entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            SceneEntity  playerObj    = (SceneEntity)ToLua.CheckUnityObject(L, 2, typeof(SceneEntity));
            int          yunbiao      = (int)LuaDLL.luaL_checknumber(L, 3);
            entityCreate.CreateBeauty(playerObj, yunbiao);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
    private static int set_hidePlayer(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            EntityCreate entityCreate = (EntityCreate)obj;
            bool         hidePlayer   = LuaDLL.luaL_checkboolean(L, 2);
            entityCreate.hidePlayer = hidePlayer;
            result = 0;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index hidePlayer on a nil value");
        }
        return(result);
    }
Esempio n. 10
0
    private static int AddFastShadow(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 3);
            EntityCreate           entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            GameObject             model        = (GameObject)ToLua.CheckUnityObject(L, 2, typeof(GameObject));
            RoleManager.EntityType type         = (RoleManager.EntityType)((int)ToLua.CheckObject(L, 3, typeof(RoleManager.EntityType)));
            entityCreate.AddFastShadow(model, type);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Esempio n. 11
0
    private static int get_positionSync(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            EntityCreate entityCreate = (EntityCreate)obj;
            PositionSync positionSync = entityCreate.positionSync;
            ToLua.Push(L, positionSync);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index positionSync on a nil value");
        }
        return(result);
    }
Esempio n. 12
0
    private static int get_cf(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            EntityCreate entityCreate = (EntityCreate)obj;
            CameraFollow cf           = entityCreate.cf;
            ToLua.Push(L, cf);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index cf on a nil value");
        }
        return(result);
    }
Esempio n. 13
0
    private static int get__aiderInfo(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            EntityCreate entityCreate = (EntityCreate)obj;
            string[]     aiderInfo    = entityCreate._aiderInfo;
            ToLua.Push(L, aiderInfo);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index _aiderInfo on a nil value");
        }
        return(result);
    }
Esempio n. 14
0
    private static int get_isInAsynceLoad(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            EntityCreate entityCreate   = (EntityCreate)obj;
            bool         isInAsynceLoad = entityCreate.isInAsynceLoad;
            LuaDLL.lua_pushboolean(L, isInAsynceLoad);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index isInAsynceLoad on a nil value");
        }
        return(result);
    }
Esempio n. 15
0
    private static int get__npcs(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            EntityCreate          entityCreate = (EntityCreate)obj;
            List <S2c_aoi_addnpc> npcs         = entityCreate._npcs;
            ToLua.PushObject(L, npcs);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index _npcs on a nil value");
        }
        return(result);
    }
Esempio n. 16
0
    private static int DeleteObjectsById(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 2);
            EntityCreate entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            string       id           = ToLua.CheckString(L, 2);
            bool         value        = entityCreate.DeleteObjectsById(id);
            LuaDLL.lua_pushboolean(L, value);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Esempio n. 17
0
    private static int AddAider(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 4);
            EntityCreate entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            string       model        = ToLua.CheckString(L, 2);
            string       posStr       = ToLua.CheckString(L, 3);
            int          dir          = (int)LuaDLL.luaL_checknumber(L, 4);
            entityCreate.AddAider(model, posStr, dir);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Esempio n. 18
0
    private static int InitilizeSelfEntity(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 4);
            EntityCreate       entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            Aoi_add_normalmsg  nmsg         = (Aoi_add_normalmsg)ToLua.CheckObject(L, 2, typeof(Aoi_add_normalmsg));
            S2c_aoi_syncplayer sync         = (S2c_aoi_syncplayer)ToLua.CheckObject(L, 3, typeof(S2c_aoi_syncplayer));
            string             name         = ToLua.CheckString(L, 4);
            GameObject         obj          = entityCreate.InitilizeSelfEntity(nmsg, sync, name);
            ToLua.Push(L, obj);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Esempio n. 19
0
    private static int AddEntityCreateEventListener(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 4);
            EntityCreate entityCreate = (EntityCreate)ToLua.CheckObject(L, 1, typeof(EntityCreate));
            string       name         = ToLua.CheckString(L, 2);
            LuaTypes     luaTypes     = LuaDLL.lua_type(L, 3);
            EntityCreate.OnRoleCreated callback;
            if (luaTypes != LuaTypes.LUA_TFUNCTION)
            {
                callback = (EntityCreate.OnRoleCreated)ToLua.CheckObject(L, 3, typeof(EntityCreate.OnRoleCreated));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 3);
                callback = (DelegateFactory.CreateDelegate(typeof(EntityCreate.OnRoleCreated), func) as EntityCreate.OnRoleCreated);
            }
            LuaTypes luaTypes2 = LuaDLL.lua_type(L, 4);
            EntityCreate.OnNpcCreated callback2;
            if (luaTypes2 != LuaTypes.LUA_TFUNCTION)
            {
                callback2 = (EntityCreate.OnNpcCreated)ToLua.CheckObject(L, 4, typeof(EntityCreate.OnNpcCreated));
            }
            else
            {
                LuaFunction func2 = ToLua.ToLuaFunction(L, 4);
                callback2 = (DelegateFactory.CreateDelegate(typeof(EntityCreate.OnNpcCreated), func2) as EntityCreate.OnNpcCreated);
            }
            entityCreate.AddEntityCreateEventListener(name, callback, callback2);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }