Class ChangeEvent<T>
Sends an event when a value in a field changes.
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public class ChangeEvent<T> : EventBase<ChangeEvent<T>>, IChangeEvent
Type Parameters
Name | Description |
---|---|
T |
Constructors
ChangeEvent()
Constructor.
Declaration
public ChangeEvent()
Properties
newValue
The new value.
Declaration
public T newValue { get; protected set; }
Property Value
Type | Description |
---|---|
T |
previousValue
The value before the change occured.
Declaration
public T previousValue { get; protected set; }
Property Value
Type | Description |
---|---|
T |
Methods
GetPooled(T, T)
Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use Dispose()
to release them.
Declaration
public static ChangeEvent<T> GetPooled(T previousValue, T newValue)
Parameters
Type | Name | Description |
---|---|---|
T | previousValue | The previous value. |
T | newValue | The new value. |
Returns
Type | Description |
---|---|
ChangeEvent<T> | An initialized event. |
Init()
Sets the event to its initial state.
Declaration
protected override void Init()
Overrides
UnityEngine.UIElements.EventBase<UnityEngine.UIElements.ChangeEvent<T>>.Init()