Class ExternalizableValue<T>
Helper class to store a value and a potential override.
Namespace: UnityEngine.GameFoundation.DefaultCatalog
Syntax
public sealed class ExternalizableValue<T> : IEquatable<ExternalizableValue<T>>
Type Parameters
Name | Description |
---|---|
T | The type of the wrapped object you want to override. |
Constructors
ExternalizableValue()
Default constructor.
Declaration
public ExternalizableValue()
ExternalizableValue(T)
Create a new wrapper for the given baseValue
.
Declaration
public ExternalizableValue(in T baseValue)
Parameters
Type | Name | Description |
---|---|---|
T | baseValue | The value to wrap. |
Properties
baseValue
The original value to wrap.
Declaration
public T baseValue { get; }
Property Value
Type | Description |
---|---|
T |
currentValue
The current value exposed by this wrapper.
Declaration
public T currentValue { get; }
Property Value
Type | Description |
---|---|
T |
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
Equals(ExternalizableValue<T>)
Declaration
public bool Equals(ExternalizableValue<T> other)
Parameters
Type | Name | Description |
---|---|---|
ExternalizableValue<T> | other |
Returns
Type | Description |
---|---|
Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
Operators
Implicit(T to ExternalizableValue<T>)
Implicitly create a new wrapper for the given value
using it as baseValue.
Declaration
public static implicit operator ExternalizableValue<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The object to wrap. |
Returns
Type | Description |
---|---|
ExternalizableValue<T> | Return a new instance of ExternalizableValue<T> using the given |
Implicit(ExternalizableValue<T> to T)
Implicitly cast the given wrapper
to T
using its currentValue.
Declaration
public static implicit operator T(ExternalizableValue<T> wrapper)
Parameters
Type | Name | Description |
---|---|---|
ExternalizableValue<T> | wrapper | The instance to cast. |
Returns
Type | Description |
---|---|
T | Return the currentValue of the given |