using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using GameLogic; namespace GameLogic { public class BuglySdkManager : GameCore.UnitySingleton { // Use this for initialization void Awake() { // 开启SDK的日志打印,发布版本请务必关闭 BuglyAgent.ConfigDebugMode(AppConst.ShowDebug); BuglyAgent.ConfigAutoQuitApplication(false); // 注册日志回调,替换使用 'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式 // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler); #if UNITY_IPHONE || UNITY_IOS // BuglyAgent.InitWithAppId (AppConst.Bugly_IosAppId); BuglyAgent.InitWithAppId ("c07e578650"); #elif UNITY_ANDROID // BuglyAgent.InitWithAppId(AppConst.Bugly_AndroidAppId); BuglyAgent.InitWithAppId("9b909facba"); #endif // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可 BuglyAgent.EnableExceptionHandler(); BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError); } /// /// 登录成功后调用 /// /// public void SetUserId(string userId) { BuglyAgent.SetUserId(userId); } public void SetVersion(string channel, string version, string user, long delay) { BuglyAgent.ConfigDefault(channel, version, user, delay); } // Update is called once per frame //void OnGUI() //{ // if (GUI.Button(new Rect(0, 0, 80, 60), "FindGameObj")) // { // GameObject go = GameObject.Find("cc").gameObject; // print(go.name); // } // if (GUI.Button(new Rect(80, 0, 80, 60), "LogError")) // { // Debug.LogError("错误提示"); // } // if (GUI.Button(new Rect(160, 0, 80, 60), "Log")) // { // Debug.Log("正常提示"); // } // if (GUI.Button(new Rect(240, 0, 80, 60), "LogWarning")) // { // Debug.LogWarning("警告提示"); // } //} } }