SUIToggle
Index
Functions Index
Function Name
Properties Index
Property Name
Functions
OnValueChanged
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)Space.Host.ExecutingObject.UIToggle.Enabled = true--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)Space.Host.ExecutingObject.UIToggle.Interactable = true--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)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)Space.Host.ExecutingObject.UIToggle.NormalColor = Color.RedSpace.Host.ExecutingObject.UIToggle.HighlightedColor = Color.RedSpace.Host.ExecutingObject.UIToggle.PressedColor = Color.RedSpace.Host.ExecutingObject.UIToggle.DisabledColor = Color.RedSpace.Host.ExecutingObject.UIToggle.ColorMultiplier = 1.2theGameObject = Space.Host.ExecutingObject.UIToggle.GameObject