Binds a function to be triggered when value of the UIToggle changes.
Parameter
Type
Description
function ovc()
--
end
Space.Host.ExecutingObject.UIToggle.OnValueChanged(ovc)
--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").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowNotificationButton= true
else
Space.UI.ShowNotificationButton= false
end
end
toggle.OnValueChanged(OnValueChanged)
--clicking this object will toggle a Toggles's Enabled status
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
toggle.Enabled = not toggle.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
--clicking this object will toggle a Toggles's Interactable status
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
toggle.Interactable= not toggle.Interactable
end
thisGameObject.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").UIToggle
OnValueChanged = function()
if toggle.IsOn then
Space.UI.ShowNotificationButton= true
else
Space.UI.ShowNotificationButton= false
end
end
toggle.OnValueChanged(OnValueChanged)