Main.cs 952 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Main : MonoBehaviour
  5. {
  6. // Start is called before the first frame update
  7. void Start()
  8. {
  9. BuglyAgent.ConfigDebugMode(true);
  10. // 注册日志回调,替换使用 'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
  11. // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);
  12. #if UNITY_IPHONE || UNITY_IOS
  13. BuglyAgent.InitWithAppId (BuglyAppIDForiOS);
  14. #elif UNITY_ANDROID
  15. BuglyAgent.InitWithAppId("766c5bdb0f");
  16. #endif
  17. // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
  18. BuglyAgent.EnableExceptionHandler();
  19. GameObject go = null;
  20. go.name = "";
  21. }
  22. // Update is called once per frame
  23. void Update()
  24. {
  25. }
  26. }