• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

7. Unity3d Lua框架 - xLua - Global 加载全局模块,所有全局性的东西都在这里加载, ...

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
--[[
-- 1、加载全局模块,所有全局性的东西都在这里加载,好集中管理
-- 2、模块定义时一律用local再return,模块是否是全局模块由本脚本决定,在本脚本加载的一律为全局模块
-- 3、对必要模块执行初始化
-- 注意:
-- 1、全局的模块和被全局模块持有的引用无法GC,除非显式设置为nil
-- 2、除了单例类、通用的工具类、逻辑上的静态类以外,所有逻辑模块不要暴露到全局命名空间
-- 3、Unity侧导出所有接口到CS命名空间,访问cs侧函数一律使用CS.xxx,命名空间再cs代码中给了,这里不需要处理
-- 4、这里的全局模块是相对与游戏框架或者逻辑而言,lua语言层次的全局模块放Common.Main中导出
--]]

-- 加载全局模块
require "Framework.Common.BaseClass"
require "Framework.Common.DataClass"
require "Framework.Common.ConstClass"

-- 创建全局模块
Config = require "Global.Config"
Singleton = require "Framework.Common.Singleton"
Updatable = require "Framework.Common.Updatable"
UpdatableSingleton = require "Framework.Common.UpdatableSingleton"
SortingLayerNames = require "Global.SortingLayerNames"
Logger = require "Framework.Logger.Logger"
require "Framework.Updater.Coroutine"

-- game data
DataMessageNames = require "DataCenter.Config.DataMessageNames"
DataManager = require "DataCenter.DataManager"
ClientData = require "DataCenter.ClientData.ClientData"
ServerData = require "DataCenter.ServerData.ServerData"
UserData = require "DataCenter.UserData.UserData"

-- game config
LangUtil = require "Config.LangUtil"

-- ui base
UIUtil = require "Framework.UI.Util.UIUtil"
UIBaseModel = require "Framework.UI.Base.UIBaseModel"
UIBaseCtrl = require "Framework.UI.Base.UIBaseCtrl"
UIBaseComponent = require "Framework.UI.Base.UIBaseComponent"
UIBaseContainer = require "Framework.UI.Base.UIBaseContainer"
UIBaseView = require "Framework.UI.Base.UIBaseView"

-- ui component
UILayer = require "Framework.UI.Component.UILayer"
UICanvas = require "Framework.UI.Component.UICanvas"
UIText = require "Framework.UI.Component.UIText"
UIImage = require "Framework.UI.Component.UIImage"
UISlider = require "Framework.UI.Component.UISlider"
UIInput = require "Framework.UI.Component.UIInput"
UIButton = require "Framework.UI.Component.UIButton"
UIToggleButton = require "Framework.UI.Component.UIToggleButton"
UIWrapComponent = require "Framework.UI.Component.UIWrapComponent"
UITabGroup = require "Framework.UI.Component.UITabGroup"
UIButtonGroup = require "Framework.UI.Component.UIButtonGroup"
UIWrapGroup = require "Framework.UI.Component.UIWrapGroup"
UIEffect = require "Framework.UI.Component.UIEffect"

-- ui window
UILayers = require "Framework.UI.UILayers"
UIWindow = require "Framework.UI.UIWindow"
UIManager = require "Framework.UI.UIManager"
UIMessageNames = require "Framework.UI.Message.UIMessageNames"
UIWindowNames = require "UI.Config.UIWindowNames"
UIConfig = require "UI.Config.UIConfig"

-- res
ResourcesManager = require "Framework.Resource.ResourcesManager"
GameObjectPool = require "Framework.Resource.GameObjectPool"

-- update & time
Timer = require "Framework.Updater.Timer"
TimerManager = require "Framework.Updater.TimerManager"
UpdateManager = require "Framework.Updater.UpdateManager"
LogicUpdater = require "GameLogic.Main.LogicUpdater"

-- scenes
BaseScene = require "Framework.Scene.Base.BaseScene"
SceneManager = require "Framework.Scene.SceneManager"
SceneConfig = require "Scenes.Config.SceneConfig"

-- atlas
AtlasConfig = require "Resource.Config.AtlasConfig"
AtlasManager = require "Framework.Resource.AtlasManager"

-- effect
EffectConfig = require "Resource.Config.EffectConfig"
BaseEffect = require "Framework.Resource.Effect.Base.BaseEffect"
EffectManager = require "Framework.Resource.Effect.EffectManager"

-- net
HallConnector = require "Net.Connector.HallConnector"

-- 单例类初始化
UIManager:GetInstance()
DataManager:GetInstance()
ResourcesManager:GetInstance()
UpdateManager:GetInstance()
SceneManager:GetInstance()
AtlasManager:GetInstance()
LogicUpdater:GetInstance()
HallConnector:GetInstance()

支付宝捐赠


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
OpenResty(nginx+lua) 入门发布时间:2022-07-22
下一篇:
linux(kali)中使用wireshark lua插件问题发布时间:2022-07-22
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap