Beispiel #1
0
 void Awake()
 {
     self = this;
     #if UNITY_IPHONE
     IOS.applicationDidFinishLaunching();
     #endif
 }
Beispiel #2
0
    /// <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);
        }
    }
Beispiel #3
0
 public static IOSInterface CreateIOSInterfaceObject()
 {
     if (self == null)
     {
         GameObject go = new GameObject("IOSInterface");
         self = go.AddComponent <IOSInterface>();
     }
     return(self);
 }
Beispiel #4
0
    /// <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
    }
Beispiel #5
0
 void OnDestroy()
 {
     self = null;
 }
Beispiel #6
0
 void Init()
 {
     ios = new IOSInterface();
 }
Beispiel #7
0
 void Awake()
 {
     self = this;
     DontDestroyOnLoad(this.gameObject);
 }