(d9829ac) v0.9.4.0

This commit is contained in:
Regalis
2019-10-24 18:05:42 +02:00
parent 9aa12bcac2
commit b39922a074
319 changed files with 12516 additions and 6815 deletions
@@ -89,11 +89,22 @@ namespace Barotrauma
return str;
}
public static Color GradientLerp(float t, params Color[] gradient)
{
if (t <= 0.0f) return gradient[0];
if (t >= 1.0f) return gradient[gradient.Length - 1];
System.Diagnostics.Debug.Assert(gradient.Length > 0, "Empty color array passed to the GradientLerp method");
if (gradient.Length == 0)
{
#if DEBUG
DebugConsole.ThrowError("Empty color array passed to the GradientLerp method.\n" + Environment.StackTrace);
#endif
GameAnalyticsManager.AddErrorEventOnce("ToolBox.GradientLerp:EmptyColorArray", GameAnalyticsSDK.Net.EGAErrorSeverity.Error,
"Empty color array passed to the GradientLerp method.\n" + Environment.StackTrace);
return Color.Black;
}
if (t <= 0.0f) { return gradient[0]; }
if (t >= 1.0f) { return gradient[gradient.Length - 1]; }
float scaledT = t * (gradient.Length - 1);