This commit is contained in:
2020-07-16 23:06:09 +08:00
parent 22546a0c6c
commit 4221cf486c
20 changed files with 84 additions and 62 deletions

View File

@@ -36,18 +36,13 @@ CLLMainLua.init = function()
ReporterMessageReceiver.self:setLua()
end
-- 设置显示状态栏
-- Screen.fullScreen = false
-- AndroidStatusBar.setColor(AndroidStatusBar.DEFAULT_BACKGROUND_COLOR)
-- AndroidStatusBar.statusBarState = AndroidStatusBar.States.Visible
-- AndroidStatusBar.dimmed = false
-- AndroidStatusBar.setFlags(AndroidStatusBar.WINDOW_FLAG_FORCE_NOT_FULLSCREEN)
-- CS.ApplicationChrome.statusBarState = CS.ApplicationChrome.States.Visible
-- CS.ApplicationChrome.dimmed = false
-- CS.ApplicationChrome.setSoftInputMode(CS.ApplicationChrome.ADJUST_RESIZE);
local success, msg = pcall(CLLMainLua.setAndroidStatusBar)
if not success then
printe(msg)
end
--设置帧率
Application.targetFrameRate = 10
Application.targetFrameRate = 30
-- QualitySettings.SetQualityLevel(1, false)
Time.fixedDeltaTime = 0.5
@@ -67,13 +62,38 @@ CLLMainLua.init = function()
-- fps.enabled = false
-- end
-- 统计sprite的使用情况
if CLCfgBase.self.isEditMode and CLCfgBase.self.isContBorrowSpriteTimes then
UIAtlas.onBorrowSpriteCallback = onBorrowedSpriteCB
end
end
function CLLMainLua.setAndroidStatusBar()
printe(SystemInfo.deviceName, "====", SystemInfo.deviceModel)
if CLPathCfg.self.platform ~= "Android" then
return
end
local mode = SystemInfo.deviceModel
if string.find(mode, "huawei") then
AndroidStatusBar.setFlags(AndroidStatusBar.WINDOW_FLAG_FORCE_NOT_FULLSCREEN)
AndroidStatusBar.setColor(AndroidStatusBar.DEFAULT_BACKGROUND_COLOR)
else
ApplicationChrome.statusBarState = ApplicationChrome.States.Visible
ApplicationChrome.dimmed = false
end
-- Screen.fullScreen = false
-- AndroidStatusBar.setColor(AndroidStatusBar.DEFAULT_BACKGROUND_COLOR)
-- AndroidStatusBar.statusBarState = AndroidStatusBar.States.Visible
-- AndroidStatusBar.dimmed = false
-- AndroidStatusBar.setFlags(AndroidStatusBar.WINDOW_FLAG_FORCE_NOT_FULLSCREEN)
-- CS.ApplicationChrome.statusBarState = CS.ApplicationChrome.States.Visible
-- CS.ApplicationChrome.dimmed = false
-- CS.ApplicationChrome.setSoftInputMode(CS.ApplicationChrome.ADJUST_RESIZE);
end
-- 当离线调用
function CLLMainLua.onOffline()
local ok, result = pcall(procOffLine)
@@ -107,7 +127,7 @@ function CLLMainLua.OnApplicationPause(isPause)
GC.Collect()
else
-- 设置帧率
Application.targetFrameRate = 10
Application.targetFrameRate = 30
end
for k, v in pairs(mApplicationPauseDelegate) do
Utl.doCallback(v, isPause)

View File

@@ -125,7 +125,7 @@ function CLLNet.dispatch(map)
if (succ ~= NetSuccess) then
retInfor.msg = Localization.Get(joinStr("Error_", succ))
MyUtl.toastE(retInfor.msg)
MyUtl.toastW(retInfor.msg)
hideHotWheel()
else
-- success

View File

@@ -65,7 +65,7 @@ local dispatch = function(content, params)
printe(joinStr("cmd:[", cmd, "]code:[", code, "]msg:", msg))
-- retInfor.msg = Localization.Get(joinStr("Error_", succ))
if not isNilOrEmpty(msg) then
MyUtl.toastE(msg)
MyUtl.toastW(msg)
end
hideHotWheel()
else
@@ -106,7 +106,7 @@ end
NetProto.sendGet = function(cmd, map, callback, failedCallback, orgs, _baseUrl)
if isNilOrEmpty(NetProto.sign) and (cmd ~= NetProto.cmds.getTokenForAPI) then
MyUtl.toastE("与服务器失去联络,请重试!")
MyUtl.toastW("与服务器失去联络,请重试!")
NetProto.init()
return
end
@@ -154,7 +154,7 @@ function NetProto.init(callback)
end
end,
function()
MyUtl.toastE("取得会话ID失败")
MyUtl.toastW("取得会话ID失败")
Utl.doCallback(callback, false)
end
)

View File

@@ -103,6 +103,8 @@ B2OutputStream = CS.Coolape.B2OutputStream
CLAlert = CS.Coolape.CLAlert
---@type Coolape.AndroidStatusBar
AndroidStatusBar = CS.Coolape.AndroidStatusBar
---@type Coolape.ApplicationChrome
ApplicationChrome = CS.ApplicationChrome
---other
---@type MyMain

View File

@@ -4,7 +4,7 @@ KKLogListener = {}
function KKLogListener.OnLogError(log)
-- 当有异常日志时
if MyUtl then
MyUtl.toastE("有异常日志,请在屏幕画圈查看详细!")
MyUtl.toastW("有异常日志,请在屏幕画圈查看详细!")
end
end

View File

@@ -61,7 +61,7 @@ MonoBehaviour:
relative: 1
absolute: 0
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mColor: {r: 0.6, g: 0.6, b: 0.6, a: 1}
mPivot: 4
mWidth: 116
mHeight: 116
@@ -248,14 +248,14 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
ignoreTimeScale: 1
delay: 0
duration: 0.5
delay: 0.5
duration: 1
steeperCurves: 0
tweenGroup: 0
onFinished: []
eventReceiver: {fileID: 0}
callWhenFinished:
from: 0.01
from: 0.05
to: 1
--- !u!1 &1125343093923812
GameObject:
@@ -296,7 +296,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1125343093923812}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1b3dc54f924693f41b5cbecb267e647a, type: 3}
m_Name:
@@ -318,7 +318,7 @@ MonoBehaviour:
relative: 1
absolute: 0
updateAnchors: 1
mColor: {r: 0.21176471, g: 0.21176471, b: 0.21176471, a: 1}
mColor: {r: 0.6, g: 0.6, b: 0.6, a: 1}
mPivot: 4
mWidth: 400
mHeight: 300
@@ -403,7 +403,7 @@ MonoBehaviour:
relative: 1
absolute: 0
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mColor: {r: 0.6, g: 0.6, b: 0.6, a: 1}
mPivot: 4
mWidth: 286
mHeight: 50

View File

@@ -687,7 +687,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
audioSource: {fileID: 0}
mUrl:
mDefaultAudioType: 20
mDefaultAudioType: 13
myClip: {fileID: 0}
isPlaying: 0
--- !u!1 &2195943103738195833