ObservedValueT Class |
Namespace: Gamelogic.Extensions
The ObservedValueT type exposes the following members.
Name | Description | |
---|---|---|
ObservedValueT |
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
SetSilently |
Sets the value without notification.
| |
ToString | (Inherited from Object.) |
Name | Description | |
---|---|---|
OnValueChange |
Subscribe to this event to get notified when the value changes.
|
Name | Description | |
---|---|---|
ThrowIfNull |
Throws a NullReferenceException if the object is null.
(Defined by ObjectExtensions.) |
ObservedValue<bool> showWindow; public void Start() { show = new ObservedValue(false); show.OnValueChanged += ShowHideWindow; } public void OnGUI() { showWindow.Value = GUILayout.Toggle("Show Window", showWindow.Value); } public void ShowHideWindow() { window.gameObject.SetActive(showWindow.Value); }