Exemplo n.º 1
0
        public static ModuleMgr GetModuleMgr()
        {
            if (moduleMgr == null)
            {
                moduleMgr = new ModuleMgr();
            }

            return(moduleMgr);
        }
Exemplo n.º 2
0
 void OnApplicationQuit()
 {
     if (allowQuit)
     {
         return;
     }
     ResourceManger.Clear();
     ModuleMgr.ClearAllModuleDC();
     EventCenter.Free();
     Application.Quit();
 }
Exemplo n.º 3
0
    // 初始化处理
    public static void Init()
    {
        // 不锁屏
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        // 登记所有的场景处理器
        RegisterScene();
        // TODO
        // 逻辑待补充
        ConfigMgr.LoadAll();
        ModuleMgr.InitAllModule();
    }
Exemplo n.º 4
0
 static int GetModuleMgr(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         ModuleMgr o = CommonHelper.GetModuleMgr();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 5
0
        private void LoadComponentItem(RadPanelItem MyItem, string ComponentID)
        {
            ModuleMgr myModuleMgr = new ModuleMgr();

            List <Component_Control> myControls = myModuleMgr.Get_Controls(ComponentID, Control_Type.Management, "Control_Name");

            foreach (Component_Control myControl in myControls)
            {
                RadPanelItem item = new RadPanelItem();
                item.Text  = myControl.Control_Name;
                item.Value = myControl.ControlID;

                MyItem.Items.Add(item);
            }
        }
Exemplo n.º 6
0
    /// <summary>
    /// 初始化游戏核心
    /// </summary>
    public void InitGameCore(GameObject gameObject)
    {
        //初始化各种管理器
        resourceMgr     = ResourceMgr.GetInstance();
        gameLauncherObj = gameObject;
        LocalDataMgr.GetInstance().LoadStartConfig(() =>
        {
            resourceMgr.Init();
        });

        uiMgr     = new UIMgr();
        moduleMgr = new ModuleMgr();
        levelMgr  = gameObject.AddComponent <LevelMgr>();

        GameStart();
    }
Exemplo n.º 7
0
    private void Awake()
    {
        DontDestroyOnLoad(this);

        _moduleMgr = new ModuleMgr();
        _moduleMgr.AddModule(new AssetBundleModule());
        _moduleMgr.AddModule(new UIModule());
        _moduleMgr.AddModule(new SceneModule());
        _moduleMgr.AddModule(new HealthModule(5));
        _moduleMgr.AddModule(new ScoreModule());
        _moduleMgr.Init();

        AssetBundleFacade.LoadAssetBundle?.Invoke("texture.bundle");
        AssetBundleFacade.LoadAssetBundle?.Invoke("config.bundle");

        SceneFacade.LoadScene?.Invoke("Start");
    }
Exemplo n.º 8
0
    /// <summary>
    /// 初始化游戏核心
    /// </summary>
    public void InitGameCore(GameObject gameObject)
    {
        //将lua初始化移动到这里,所有的必要条件都准备好以后再初始化lua虚拟机
        luaClient = gameObject.AddComponent <LuaEngine>();
        //初始化各种管理器
        resourceMgr     = ResourceMgr.GetInstance();
        gameLauncherObj = gameObject;
        LocalDataMgr.GetInstance().LoadStartConfig(() =>
        {
            resourceMgr.Init();
        });

        uiMgr     = new UIMgr();
        moduleMgr = new ModuleMgr();
        levelMgr  = gameObject.AddComponent <LevelMgr>();

        GameStart();
    }
Exemplo n.º 9
0
    /// <summary>
    /// 初始化游戏核心
    /// </summary>
    public void InitGameCore(GameObject gameObject)
    {
        //初始化各种管理器
        resourceMgr = ResourceMgr.GetInstance();

        //Lua的资源管理器接口
        luaResourceMgr = LuaResourceMgr.GetInstance();

        gameLauncherObj = gameObject;
        LocalDataMgr.GetInstance().LoadStartConfig(() =>
        {
            resourceMgr.Init();
        });

        uiMgr     = new UIMgr();
        moduleMgr = new ModuleMgr();
        sceneMgr  = gameObject.AddComponent <SceneMgr>();

        luaClient = gameObject.AddComponent <LuaEngine>();

        GameStart();
    }
Exemplo n.º 10
0
        public void LoadComponentRoot()
        {
            // Remove all Item before add new one
            RadPanelBar_ControlPanel.Items.Clear();

            ModuleMgr     myModuleMgr = new ModuleMgr();
            List <Module> myModules   = myModuleMgr.Get_Modules("Module_Name");

            foreach (Module myModule in myModules)
            {
                List <Modules.Component> myComponents = myModuleMgr.Get_Components(myModule.ModuleID, "-1", Component_Type.ControlPanel, "Component_Name");

                foreach (Modules.Component myComponent in myComponents)
                {
                    RadPanelItem item = new RadPanelItem();
                    item.Text     = myComponent.Component_Name;
                    item.ImageUrl = myComponent.Component_Icon;

                    LoadComponentItem(item, myComponent.ComponentID);

                    RadPanelBar_ControlPanel.Items.Add(item);
                }
            }
        }