Skip to content

EqualityHelper Class

Helper methods for ScriptableValues.

C#
public static class EqualityHelper

Inheritance object

Helper method for checking if two types are the same.

C#
public static bool Equals<T>(T x, T y)

x T
The first object to compare.

y T
The second object to compare.

bool
true if the specified objects are equal; otherwise, false.

This takes Unity objects into consideration.

Helper method for checking if an object is null.

C#
public static bool IsNull<T>(T? obj)

obj T
The object to check.

bool
true if the object is null; otherwise false.

This takes Unity objects into consideration.

Helper method to check if the given object is the same type as the provided generic type.

C#
public static bool IsSameType<TType>(object? value, out TType? newValue)

value object
The object value to check.

newValue TType
The value as the generic value.

bool
true if the value is the same type; otherwise false.

ArgumentNullException
value is null.