Marking player location on galaxy map Fixed non-input field focus disabling global key map Player start ship is now always the same Loadout generator now demands exact match for item dimensions Thermal damage now triggers ItemDamaged event = player can die from cockpit wear! Properties panel now has a much more attractive UI Implemented curve control for properties UI Centralized number formatting in player settings Moved significant digits to player settings Added temperature unit option in player settings
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
/// <summary>
|
|
/// Tool script taken from the UI source as it's set to Internal for some reason. So to use in the extensions project it is needed here also.
|
|
/// </summary>
|
|
///
|
|
namespace UnityEngine.UI.Extensions
|
|
{
|
|
internal static class SetPropertyUtility
|
|
{
|
|
public static bool SetColor(ref Color currentValue, Color newValue)
|
|
{
|
|
if (currentValue.r == newValue.r && currentValue.g == newValue.g && currentValue.b == newValue.b && currentValue.a == newValue.a)
|
|
return false;
|
|
|
|
currentValue = newValue;
|
|
return true;
|
|
}
|
|
|
|
public static bool SetStruct<T>(ref T currentValue, T newValue) where T: struct
|
|
{
|
|
if (currentValue.Equals(newValue))
|
|
return false;
|
|
|
|
currentValue = newValue;
|
|
return true;
|
|
}
|
|
|
|
public static bool SetClass<T>(ref T currentValue, T newValue) where T: class
|
|
{
|
|
if ((currentValue == null && newValue == null) || (currentValue != null && currentValue.Equals(newValue)))
|
|
return false;
|
|
|
|
currentValue = newValue;
|
|
return true;
|
|
}
|
|
}
|
|
}
|