Exemple #1
0
    private void TrackRequestWithObject(AssetRequestInfo req, UnityEngine.Object obj)
    {
        if (obj == null || !_enableTracking || !PrepareWriter())
        {
            return;
        }

        try
        {
            req.RecordObject(obj);

            string info = req.ToString();
            if (_logWriter != null && !string.IsNullOrEmpty(info))
            {
                _logWriter.WriteLine(info);
            }

            _lastWriteTime = DateTime.Now;
        }
        catch (Exception ex)
        {
            UnityEngine.Debug.LogErrorFormat("[ResourceTracker.TrackRequestWithObject] error: {0} \n {1} \n {2}",
                                             ex.Message, req != null ? req.ToString() : "", ex.StackTrace);
        }
    }
 private void TrackRequestWithObject(AssetRequestInfo req, Object obj)
 {
     if (Object.op_Equality(obj, (Object)null) || !this._enableTracking || !this.PrepareWriter())
     {
         return;
     }
     if (!((Behaviour)LoadingStats.Instance).get_enabled())
     {
         return;
     }
     try
     {
         req.RecordObject(obj);
         string str = req.ToString();
         if (this._logWriter != null && !string.IsNullOrEmpty(str) && req.duration >= 1.0)
         {
             this._logWriter.WriteLine(str);
         }
         this._lastWriteTime = DateTime.Now;
     }
     catch (Exception ex)
     {
         Debug.LogErrorFormat("[ResourceTracker.TrackRequestWithObject] error: {0} \n {1} \n {2}", new object[3]
         {
             (object)ex.Message,
             req == null ? (object)string.Empty : (object)req.ToString(),
             (object)ex.StackTrace
         });
     }
 }