wiki.sine.space | sinespace

Difference between revisions of "Scripting/SAttachmentHelper"

From wiki.sine.space
Jump to: navigation, search
(Created page with "=Properties= {{ScriptFunction|bool|Enabled|[get, set]|Returns true if the Attachment Helper Enabled.|5=local Object = Space.Scene.Find("SCRIPT_OBJECT")<br> Space.Log(Object.At...")
 
Line 1: Line 1:
 
=Properties=
 
=Properties=
{{ScriptFunction|bool|Enabled|[get, set]|Returns true if the Attachment Helper Enabled.|5=local Object = Space.Scene.Find("SCRIPT_OBJECT")<br>
+
{{ScriptFunction|bool|Enabled|[get, set]|Returns true if the Attachment Helper Enabled.|5= Space.Host.ExecutingObject.AttachmentHelper.Enabled = false|6=<pre>--clicking this object will Enable/Disable it's Attachment Helper component
Space.Log(Object.AttachmentHelper.Enabled)
+
thisGameObject = Space.Host.ExecutingObject
 +
attachmenthelper = thisGameObject.AttachmentHelper
 +
 
 +
 
 +
OnClick = function()
 +
attachmenthelper.Enabled =  not attachmenthelper.Enabled
 +
end
 +
 
 +
 
 +
thisGameObject.AddClickable()
 +
thisGameObject.Clickable.OnClick(OnClick)</pre>)
 
}}
 
}}
  
 
{{Scripting Navbox}}
 
{{Scripting Navbox}}

Revision as of 03:26, 13 October 2021

Properties

Enabled

bool Enabled [get, set]

Returns true if the Attachment Helper Enabled.

Space.Host.ExecutingObject.AttachmentHelper.Enabled = false


--clicking this object will Enable/Disable it's Attachment Helper component
thisGameObject = Space.Host.ExecutingObject
attachmenthelper = thisGameObject.AttachmentHelper


OnClick = function()
attachmenthelper.Enabled =  not attachmenthelper.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
)