/// <summary> /// Fills all the values of target varvalue by interpolating values from the two given varvalues with the given factor. /// </summary> public static void Interpolate(this SpriterVarValue target, SpriterVarValue valA, SpriterVarValue valB, float factor) { target.Type = valA.Type; target.StringValue = valA.StringValue; target.FloatValue = MathHelper.Linear(valA.FloatValue, valB.FloatValue, factor); target.IntValue = (int)MathHelper.Linear(valA.IntValue, valB.IntValue, factor); }
private object GetValue(SpriterVarValue varValue) { object value; switch (varValue.Type) { case SpriterVarType.Float: value = varValue.FloatValue; break; case SpriterVarType.Int: value = varValue.IntValue; break; default: value = varValue.StringValue; break; } return(value); }