private static void ComparePackageLists(List <NugetPackage> updates, List <NugetPackage> updatesReplacement, string errorMessageToDisplayIfListsDoNotMatch) { System.Text.StringBuilder matchingComparison = new System.Text.StringBuilder(); System.Text.StringBuilder missingComparison = new System.Text.StringBuilder(); foreach (NugetPackage package in updates) { if (updatesReplacement.Contains(package)) { matchingComparison.Append(matchingComparison.Length == 0 ? "Matching: " : ", "); matchingComparison.Append(package.ToString()); } else { missingComparison.Append(missingComparison.Length == 0 ? "Missing: " : ", "); missingComparison.Append(package.ToString()); } } System.Text.StringBuilder extraComparison = new System.Text.StringBuilder(); foreach (NugetPackage package in updatesReplacement) { if (!updates.Contains(package)) { extraComparison.Append(extraComparison.Length == 0 ? "Extra: " : ", "); extraComparison.Append(package.ToString()); } } if (missingComparison.Length > 0 || extraComparison.Length > 0) { Debug.LogWarningFormat("{0}\n{1}\n{2}\n{3}", errorMessageToDisplayIfListsDoNotMatch, matchingComparison, missingComparison, extraComparison); } }
/// Potentially removes cached mesh data some of the batches in this pool. public void ClearCachedGeometryFromBatches() { if (BatchManager.kTimeUntilBatchImmutable > 0) { // Current heuristics are: // - Always keep the cache for the most recent kBatchesToLeaveMutable Batches // - Otherwise, keep the cache until kTimeUntilBatchImmutable frames after the last write int currentTime = m_owner.CurrentTimestamp; for (int i = 0; i < m_Batches.Count - BatchManager.kBatchesToLeaveMutable; ++i) { Batch batch = m_Batches[i]; if (batch.Geometry.IsGeometryResident) { int timeSinceLastUpdate = currentTime - batch.LastMeshUpdate; if (timeSinceLastUpdate > BatchManager.kTimeUntilBatchImmutable) { batch.ClearCachedGeometry(); } else if (timeSinceLastUpdate < 0) { Debug.LogWarningFormat( "{0} {1}: Should never happen: batch updated in the future: {2}", BrushCatalog.m_Instance.GetBrush(m_BrushGuid).m_Description, i, timeSinceLastUpdate); // A cheesy way of forcing timeSinceLastUpdate to 0 batch.DelayedUpdateMesh(); } } } } }
public static void Warn(string tag, string format, params object[] args) { if (!string.IsNullOrEmpty(tag) && !enabledTags.Contains(tag)) { return; } Debug.LogWarningFormat(format, args); }
public void WarnFormat(IFormatProvider provider, string format, params object[] args) { if (!IsWarnEnabled) { return; } Debugger.LogWarningFormat(format, args); }
public void WarnFormat(string format, object arg0, object arg1, object arg2) { if (!IsWarnEnabled) { return; } Debugger.LogWarningFormat(format, arg0, arg1, arg2); }
/// <summary>Update current time, and try to trigger event.</summary> /// <param name="newCurrent"></param> private void TriggerEventIfCrossSession(DateTime newCurrent) { if (newCurrent == m_Current) { return; } DateTime oldCurrent = m_Current; m_Current = newCurrent; if (lastSession < newCurrent && newCurrent < nextSession) { // Debug.Log("Within session"); } else if (newCurrent >= nextSession) { // Debug.Log("Pass session detected."); int diff = 0; DateTime oldNextSession = nextSession; CalculateSession(); while (m_Current > oldNextSession && diff < int.MaxValue) { oldNextSession = oldNextSession.Add(oneSession); diff++; } Debug.LogFormat("Session updated: <color=green>Diff {0}</color>\n\rLast Current {1:G}\n\rCurrent {2:G}, \n\n\rLast Session {3:G}\n\rNext Session {4:G}\n\n\rOne Session {5:c}\n", diff, oldCurrent, m_Current, lastSession, nextSession, oneSession); if (EVENT_SessionChanged != null) { EVENT_SessionChanged(oldCurrent, m_Current, diff); } } // The latest time(newCurrent) are smaller than the record that we had, back to the future. else // if (newCurrent < oldCurrent) { CalculateSession(); if (newCurrent < lastSession) { Debug.LogErrorFormat("Time traveler detected := Session Jumpped.\ncurrent : {0:G} -> {1:G},\nLast session : {2:G}\nNext Session : {3:G}\nOne session : {4:c}", m_Current, newCurrent, lastSession, nextSession, oneSession); } else { Debug.LogWarningFormat("Time traveler detected := within session.\ncurrent : {0:G} -> {1:G},\nLast session : {2:G}\nNext Session : {3:G}\nOne session : {4:c}", m_Current, newCurrent, lastSession, nextSession, oneSession); } if (EVENT_SessionChanged != null) { EVENT_SessionChanged(oldCurrent, m_Current, -1); } } }
private void SendWithChecksum(byte [] data, int length) { // add a CRC64 checksum in the reserved space ulong crc = Crc64.Compute(data, RESERVED, length - RESERVED); var encoder = new Encoder(data, 0); encoder.Encode64U(crc); RawSend(data, length); if (kcp.WaitSnd > 1000) { Debug.LogWarningFormat("Too many packets waiting in the send queue {0}, you are sending too much data, the transport can't keep up", kcp.WaitSnd); } }
public static void LogWarningFormat(string format, params object[] message) { #if NOLOG return; #endif if (Debug.isDebugBuild) { Debug.LogWarningFormat(format, message); #if !UNITY_EDITOR if (MDNManager.Instance != null) { MDNManager.Instance.ShowXcodeLog(string.Format(format, message)); } #endif } }
public override void Release(IResourceLocation location, object asset) { if (location == null) { throw new ArgumentNullException(nameof(location)); } if (asset == null) { UDebug.LogWarningFormat("Releasing null asset bundle from location {0}. This is an indication that the bundle failed to load.", location); return; } if (asset is ModularAssetBundleResource bundle) { bundle.Unload(); } }
public static void LogWarning(string format, params object[] args) { Debug.LogWarningFormat(format, args); }