【SpriteLoader】修改初始化位置,兼容老包
parent
e0b0140609
commit
9cce82f017
|
@ -67,5 +67,3 @@ AppConst.Bugly_IosAppId = "c07e578650"
|
||||||
AppConst.Bugly_AndroidAppId = "9b909facba"
|
AppConst.Bugly_AndroidAppId = "9b909facba"
|
||||||
|
|
||||||
AppConst.LaQi_JoinRoom_Url = "com.doudou.dwc://data/openwith?"
|
AppConst.LaQi_JoinRoom_Url = "com.doudou.dwc://data/openwith?"
|
||||||
|
|
||||||
SpriteLoader = require("Modules.Common.SpriteLoader")
|
|
|
@ -12,6 +12,7 @@ ServerConfigManager.SettingConfig = {
|
||||||
IS_SHOW_HEALTH_TIP = "IS_SHOW_HEALTH_TIP", -- 是否显示健康提示
|
IS_SHOW_HEALTH_TIP = "IS_SHOW_HEALTH_TIP", -- 是否显示健康提示
|
||||||
NOTICE_CHANNEL = "NOTICE_CHANNEL", -- 公告号
|
NOTICE_CHANNEL = "NOTICE_CHANNEL", -- 公告号
|
||||||
PACKAGE_CC_CODE = "PACKAGE_CC_CODE", -- CC号
|
PACKAGE_CC_CODE = "PACKAGE_CC_CODE", -- CC号
|
||||||
|
SPRITE_LOADER = "SPRITE_LOADER", -- 资源加载器是否可以使用
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
local SpriteLoaderPool = {}
|
local SpriteLoaderPool = {}
|
||||||
local SpriteLoader = {}
|
local SpriteLoader = {}
|
||||||
local spLoaderIndex = 0
|
local spLoaderIndex = 0
|
||||||
|
local IsActive = ServerConfigManager.IsSettingActive(ServerConfigManager.SettingConfig.SPRITE_LOADER)
|
||||||
|
|
||||||
-- 调用此方法创建一个管理器
|
-- 调用此方法创建一个管理器
|
||||||
function SpriteLoader.New()
|
function SpriteLoader.New()
|
||||||
|
@ -19,6 +20,9 @@ function SpriteLoader.New()
|
||||||
end
|
end
|
||||||
|
|
||||||
function SpriteLoader:LoadSprite(name)
|
function SpriteLoader:LoadSprite(name)
|
||||||
|
if not IsActive then
|
||||||
|
return Util.LoadSprite(name)
|
||||||
|
end
|
||||||
local transName = GetTranslateSpriteName(name)
|
local transName = GetTranslateSpriteName(name)
|
||||||
local sp = resMgr:LoadSpriteAsset(transName)
|
local sp = resMgr:LoadSpriteAsset(transName)
|
||||||
if sp then
|
if sp then
|
||||||
|
@ -54,6 +58,9 @@ end
|
||||||
|
|
||||||
-- 销毁loader
|
-- 销毁loader
|
||||||
function SpriteLoader:Destroy()
|
function SpriteLoader:Destroy()
|
||||||
|
if not IsActive then
|
||||||
|
return
|
||||||
|
end
|
||||||
coroutine.start(function()
|
coroutine.start(function()
|
||||||
coroutine.wait(2)
|
coroutine.wait(2)
|
||||||
self:UnLoadSprite()
|
self:UnLoadSprite()
|
||||||
|
|
|
@ -22,3 +22,5 @@ U3d=UnityEngine
|
||||||
WWW = UnityEngine.WWW;
|
WWW = UnityEngine.WWW;
|
||||||
GameEventHandler=GameLogic.GameEventHandler
|
GameEventHandler=GameLogic.GameEventHandler
|
||||||
UpdateManager=GameLogic.UpdateManager
|
UpdateManager=GameLogic.UpdateManager
|
||||||
|
|
||||||
|
SpriteLoader = require("Modules.Common.SpriteLoader")
|
Loading…
Reference in New Issue