static int GetMananger(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         MsgBase obj = (MsgBase)ToLua.CheckObject <MsgBase>(L, 1);
         int     o   = obj.GetMananger();
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #2
0
    // 消息分析
    private void AnalysisMsg(MsgBase msg)
    {
        if (msg == null)
        {
            return;
        }

        int tmpId = msg.GetMananger();

        if (tmpId < (int)ManagerID.NetManager)          //  lua的消息
        {
            LuaEventProcess.Instance.ProcessEvent(msg);
        }
        else                                            // c#的消息

        {
            ManagerID managerID = (ManagerID)tmpId;
            switch (managerID)
            {
            case ManagerID.UIManager:
                UIManager.Instance.SendMsg(msg);
                break;

            case ManagerID.AudioManager:
                break;

            case ManagerID.NPCManager:
                NPCManager.Instance.SendMsg(msg);
                break;

            case ManagerID.CharactorManager:
                break;

            case ManagerID.AssetMananger:
                break;

            case ManagerID.NetManager:
                break;

            case ManagerID.DataManager:
                break;

            default:
                break;
            }
        }
    }