miduo_client/Assets/LuaFramework/Scripts/Manager/BuglySdkManager.cs

75 lines
2.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using GameLogic;
namespace GameLogic {
public class BuglySdkManager : GameCore.UnitySingleton<BuglySdkManager>
{
// 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);
}
/// <summary>
/// 登录成功后调用
/// </summary>
/// <param name="userId"></param>
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("警告提示");
// }
//}
}
}