void Awake() { self = this; #if UNITY_IPHONE IOS.applicationDidFinishLaunching(); #endif }
/// <summary> /// 打印一条错误日志 /// </summary> /// <param name="msgObj"></param> /// <param name="context"></param> public static void LogError(params object[] args) { string msgText = StringBuilderContent(args); ///目的是为了避免相同的日志输出 if (string.IsNullOrEmpty(mstrLastFileLog)) { mstrLastFileLog = msgText; } else { if (mstrLastFileLog.Equals(msgText)) { return; } mstrLastFileLog = msgText; } #if UNITY_IPHONE && !UNITY_EDITOR IOSInterface.U3DLog(msgText); #endif UnityEngine.Debug.LogError(msgText, null); if (mbFileLog) { TraceFile(2, msgText); } }
public static IOSInterface CreateIOSInterfaceObject() { if (self == null) { GameObject go = new GameObject("IOSInterface"); self = go.AddComponent <IOSInterface>(); } return(self); }
/// <summary> /// 打印一条信息日志 /// </summary> /// <param name="msgText">文本记录</param> /// <param name="context">错误对象</param> public static void Log(params object[] args) { string msgText = StringBuilderContent(args); if (mbDebugLog) { UnityEngine.Debug.Log(msgText, null); } if (mbFileLog) { TraceFile(0, msgText); } #if UNITY_IPHONE && !UNITY_EDITOR msgText = StringBuilderContent(args); IOSInterface.U3DLog(msgText); #endif }
void OnDestroy() { self = null; }
void Init() { ios = new IOSInterface(); }
void Awake() { self = this; DontDestroyOnLoad(this.gameObject); }