21 [Tooltip(
"The height that this button rests at; this value is a lerp in between the min and max height.")]
26 [SerializeField, FormerlySerializedAs(
"_toggled")]
27 private bool _isToggled =
false;
30 private bool _startToggled =
false;
38 if (_isToggled != value) {
54 [FormerlySerializedAs(
"toggleEvent")]
56 private UnityEvent _toggleEvent =
new UnityEvent();
64 [FormerlySerializedAs(
"unToggleEvent")]
73 private float _originalRestingHeight;
76 return _originalRestingHeight;
94 if (!Application.isPlaying) {
130 private void OnPressed() {
Rigidbody rigidbody
The Rigidbody associated with this interaction object.
A physics-enabled toggle. Toggling is triggered by physically pushing the toggle to its compressed po...
Vector3 RelaxedToggledLocalPosition
Returns the local position of this toggle when it is able to relax into its untoggled position.
Action OnUntoggle
Called when the toggle is unticked.
UnityEvent _untoggleEvent
Action OnToggle
Called when the toggle is ticked (not when unticked; for that, use OnUntoggle.)
float toggledRestingHeight
The height that this toggle rests at when it is toggled.
override Vector3 RelaxedLocalPosition
Returns the local position of this toggle when it is able to relax into its untoggled position.
bool isToggled
summary> Triggered when this toggle is toggled.
void Untoggle()
Sets this InteractionToggle to the "untoggled" state.
void Toggle()
Sets this InteractionToggle to the "toggled" state. Calling this function won't oscillate the state o...
override void OnDisable()
float untoggledRestingHeight