/// <summary> /// Logs a limited support message to the console for an instant preview feature. /// </summary> /// <param name="featureName">The name of the feature that has limited support.</param> public static void LogLimitedSupportMessage(string featureName) { //Debug.LogErrorFormat( // "Attempted to {0} which is not yet supported by Instant Preview.\n" + // "Please build and run on device to use this feature.", featureName); if (!s_SentWarnings.ContainsKey(featureName) || (DateTime.UtcNow - s_SentWarnings[featureName]).TotalSeconds >= k_WarningThrottleTimeSeconds) { string warning = string.Format(k_WarningToastFormat, featureName); NativeApi.SendToast(warning); s_SentWarnings[featureName] = DateTime.UtcNow; } }
/// <summary> /// Logs a limited support message to the console for an instant preview feature. /// </summary> /// <param name="featureName">The name of the feature that has limited support.</param> /// <param name="logOnce">True, only logs the warning once. /// Otherwise, repeats logging after waring throttle time.</param> public static void LogLimitedSupportMessage(string featureName, bool logOnce = false) { Debug.LogErrorFormat( "Attempted to {0} which is not yet supported by Instant Preview.\n" + "Please build and run on device to use this feature.", featureName); if (logOnce && !_oneTimeWarnings.Contains(featureName)) { string warning = string.Format(_warningToastFormat, featureName); NativeApi.SendToast(warning); _oneTimeWarnings.Add(featureName); } if (!logOnce && (!_sentWarnings.ContainsKey(featureName) || (DateTime.UtcNow - _sentWarnings[featureName]).TotalSeconds >= _warningThrottleTimeSeconds)) { string warning = string.Format(_warningToastFormat, featureName); NativeApi.SendToast(warning); _sentWarnings[featureName] = DateTime.UtcNow; } }