|
|
@@ -1,6 +1,8 @@
|
|
|
+using System;
|
|
|
using Core.AssetLoadTool.Asset;
|
|
|
using Core.Audio;
|
|
|
using Core.Language;
|
|
|
+using Core.Utility;
|
|
|
using Excel2Json;
|
|
|
using Fort23.Core;
|
|
|
using Fort23.Mono;
|
|
|
@@ -26,7 +28,7 @@ using Utility.CTween;
|
|
|
using Utility.UITool;
|
|
|
|
|
|
|
|
|
-public class GameApplction : IGameStart
|
|
|
+public class GameApplction : IGameStart, ILogSend
|
|
|
{
|
|
|
public static GameApplction gameApplction;
|
|
|
public GameRuntimeConfig gameRuntimeConfig;
|
|
|
@@ -42,18 +44,19 @@ public class GameApplction : IGameStart
|
|
|
|
|
|
private GameStartUIPanel gameStartUIPanel;
|
|
|
private System.Action LoadFinish;
|
|
|
+
|
|
|
public async void StartGame(LoadType LoadType, string h5Url, GameStartUIPanel gameStartUIPanel,
|
|
|
System.Action LoadFinish)
|
|
|
{
|
|
|
- HotSyncContent.DownloadUI= gameStartUIPanel;
|
|
|
+ HotSyncContent.DownloadUI = gameStartUIPanel;
|
|
|
this.LoadFinish = LoadFinish;
|
|
|
gameApplction = this;
|
|
|
Debug.Log("开始游戏逻辑");
|
|
|
- Crasheye.SetIsBetaVersion( true);
|
|
|
- Crasheye.SendScriptException("测试错误", "测试错误","ZH");
|
|
|
+ LogTool.LogSend = this;
|
|
|
+ Crasheye.SendScriptException("测试错误", "测试错误", "ZH");
|
|
|
// UnityEngine.Screen.SetResolution(Screen.width);
|
|
|
// GameUpdateAsset.Instance.Init(h5Url);
|
|
|
-
|
|
|
+ Crasheye.SetRegisterLogFunction(UnityLogic);
|
|
|
this.gameStartUIPanel = gameStartUIPanel;
|
|
|
gameStartUIPanel.ShowMassge("开始加载资源");
|
|
|
gameStartUIPanel.SetSlider(0);
|
|
|
@@ -64,12 +67,12 @@ public class GameApplction : IGameStart
|
|
|
GameAssetUpdatePanel gameAssetUpdatePanel = new GameAssetUpdatePanel();
|
|
|
gameAssetUpdatePanel.StartUpdateAsset(AssetUpdateFinish);
|
|
|
// await InitGameApplication();
|
|
|
-
|
|
|
|
|
|
|
|
|
Debug.Log("初始化完成");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private async void AssetUpdateFinish()
|
|
|
{
|
|
|
Debug.Log("finish AssetUpdateFinish");
|
|
|
@@ -108,7 +111,8 @@ public class GameApplction : IGameStart
|
|
|
gameStartUIPanel.ShowMassge("loadConfig");
|
|
|
gameStartUIPanel.SetSlider(0.25f);
|
|
|
|
|
|
- AssetHandle gameRuntimeAssetHandle= await AssetBundleLoadManager.Instance.LoadAssetAsyncTask<GameRuntimeConfig>("GameRuntimeConfig.asset");
|
|
|
+ AssetHandle gameRuntimeAssetHandle =
|
|
|
+ await AssetBundleLoadManager.Instance.LoadAssetAsyncTask<GameRuntimeConfig>("GameRuntimeConfig.asset");
|
|
|
gameRuntimeConfig = gameRuntimeAssetHandle.AssetObject<GameRuntimeConfig>();
|
|
|
await ConfigComponent.Instance.Preload();
|
|
|
await AnimationCurveManager.Instance.Init();
|
|
|
@@ -273,4 +277,22 @@ public class GameApplction : IGameStart
|
|
|
MarskPanel.ClosePanel();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void SendError(string massge)
|
|
|
+ {
|
|
|
+ Crasheye.SendScriptException(massge, massge, "");
|
|
|
+ }
|
|
|
+
|
|
|
+ public void SendException(Exception e)
|
|
|
+ {
|
|
|
+ Crasheye.SendScriptException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void UnityLogic(string logString, string stackTrace, LogType type)
|
|
|
+ {
|
|
|
+ if (type == LogType.Error || type == LogType.Exception)
|
|
|
+ {
|
|
|
+ Crasheye.SendScriptException(logString, stackTrace, "");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|