コード例 #1
0
    static int _CreateGameFramework_IDModel(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                GameFramework.IDModel obj = new GameFramework.IDModel();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1)
            {
                string arg0 = ToLua.CheckString(L, 1);
                GameFramework.IDModel obj = new GameFramework.IDModel(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: GameFramework.IDModel.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #2
0
        public override void Init(long _id)
        {
            base.Init(_id);
            idmodel   = new IDModel();
            timeNotes = new List <ITimeNote>();
            GameObject _temp = new GameObject();

            UnityEngine.Object.DontDestroyOnLoad(_temp);
            mono = _temp.AddComponent <MonoBase> ();
            mono.onUpdateEvent += Update;
            _temp.name          = "GameFramework.TimeModule";
        }
コード例 #3
0
        public void Destroy()
        {
            MessageModule.instance.RemoveListener(MessageType.ModuleOpen, OpenModule);
            MessageModule.instance.RemoveListener(MessageType.ModuleClose, CloseModule);

            foreach (KeyValuePair <long, IModule> _v in modules)
            {
                _v.Value.Destroy();
            }
            modules.Clear();
            modules = null;
            idModel = null;
        }
コード例 #4
0
    static int get_GetLongId(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            GameFramework.IDModel obj = (GameFramework.IDModel)o;
            long ret = obj.GetLongId;
            LuaDLL.tolua_pushint64(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index GetLongId on a nil value"));
        }
    }
コード例 #5
0
        public void Init()
        {
            idModel  = new IDModel();
            modules  = new Dictionary <long, IModule> ();
            assembly = new List <Assembly>();
            //添加需要托管的程序集,兼容ios无法加载dll
            assembly.Add(Assembly.GetExecutingAssembly());
            assembly.Add(GameContent.GameContentAssembly.assembly);

            MessageModule.instance.AddListener(MessageType.ModuleOpen, OpenModule);
            MessageModule.instance.AddListener(MessageType.ModuleClose, CloseModule);

            //默认启动的模块,这里启动的模块因为其完全封装,无法外部主动调用
            Open("GameFramework.UIModule");
            Open("GameFramework.MusicModule");
            Open("GameFramework.NetworkModule");
            Open("GameFramework.ReporterModule");

            Open("GameContent.ToLuaModule");
        }