7 internal static class SetPropertyUtility
9 public static bool SetColor(ref
Color currentValue,
Color newValue)
11 if (currentValue.r == newValue.r && currentValue.g == newValue.g && currentValue.b == newValue.b && currentValue.a == newValue.a)
14 currentValue = newValue;
18 public static bool SetStruct<T>(ref T currentValue, T newValue) where T:
struct
20 if (currentValue.Equals(newValue))
23 currentValue = newValue;
27 public static bool SetClass<T>(ref T currentValue, T newValue) where T:
class
29 if ((currentValue ==
null && newValue ==
null) || (currentValue !=
null && currentValue.Equals(newValue)))
32 currentValue = newValue;
Credit Erdener Gonenc - @PixelEnvision.