--This script will make a UI Toggle show/hide the Notification Button--[You need to add an object with UI Toggle as a reference (scripting runtime)]toggle = Space.Host.GetReference("Toggle").UIToggleOnValueChanged=function()if toggle.IsOn then Space.UI.ShowNotificationButton=trueelse Space.UI.ShowNotificationButton=falseendendtoggle.OnValueChanged(OnValueChanged)
Properties
Enabled
bool Enabledgetset
Whether the UIToggle is Enabled
Space.Host.ExecutingObject.UIToggle.Enabled =true
--clicking this object will toggle a Toggles's Enabled statusthisGameObject = Space.Host.ExecutingObjecttoggle = Space.Host.GetReference("toggle").UIToggle --make sure to add this reference to the Scripting Runtime componentOnClick=function()toggle.Enabled =not toggle.EnabledendthisGameObject.AddClickable()thisGameObject.Clickable.OnClick(OnClick)
--clicking this object will toggle a Toggles's Interactable statusthisGameObject = Space.Host.ExecutingObjecttoggle = Space.Host.GetReference("toggle").UIToggle --make sure to add this reference to the Scripting Runtime componentOnClick=function()toggle.Interactable=not toggle.InteractableendthisGameObject.AddClickable()thisGameObject.Clickable.OnClick(OnClick)
IsOn
bool IsOngetset
Whether the UIToggle is toggled On
Space.Host.ExecutingObject.UIToggle.IsOn =true
--This script will make a UI Toggle show/hide the Notification Button--[You need to add an object with UI Toggle as a reference (scripting runtime)]toggle = Space.Host.GetReference("Toggle").UIToggleOnValueChanged=function()if toggle.IsOn then Space.UI.ShowNotificationButton=trueelse Space.UI.ShowNotificationButton=falseendendtoggle.OnValueChanged(OnValueChanged)