58 lines
1.3 KiB
C#
58 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace UnityEngine.UI
|
|
{
|
|
// Token: 0x02000075 RID: 117
|
|
internal static class SetPropertyUtility
|
|
{
|
|
// Token: 0x06000457 RID: 1111 RVA: 0x00017F34 File Offset: 0x00016334
|
|
public static bool SetColor(ref Color currentValue, Color newValue)
|
|
{
|
|
bool flag;
|
|
if (currentValue.r == newValue.r && currentValue.g == newValue.g && currentValue.b == newValue.b && currentValue.a == newValue.a)
|
|
{
|
|
flag = false;
|
|
}
|
|
else
|
|
{
|
|
currentValue = newValue;
|
|
flag = true;
|
|
}
|
|
return flag;
|
|
}
|
|
|
|
// Token: 0x06000458 RID: 1112 RVA: 0x00017FA0 File Offset: 0x000163A0
|
|
public static bool SetStruct<T>(ref T currentValue, T newValue) where T : struct
|
|
{
|
|
bool flag;
|
|
if (EqualityComparer<T>.Default.Equals(currentValue, newValue))
|
|
{
|
|
flag = false;
|
|
}
|
|
else
|
|
{
|
|
currentValue = newValue;
|
|
flag = true;
|
|
}
|
|
return flag;
|
|
}
|
|
|
|
// Token: 0x06000459 RID: 1113 RVA: 0x00017FDC File Offset: 0x000163DC
|
|
public static bool SetClass<T>(ref T currentValue, T newValue) where T : class
|
|
{
|
|
bool flag;
|
|
if ((currentValue == null && newValue == null) || (currentValue != null && currentValue.Equals(newValue)))
|
|
{
|
|
flag = false;
|
|
}
|
|
else
|
|
{
|
|
currentValue = newValue;
|
|
flag = true;
|
|
}
|
|
return flag;
|
|
}
|
|
}
|
|
}
|