Line 1: | Line 1: | ||
The SGameObject class refers a single Game Object active within the scene. | The SGameObject class refers a single Game Object active within the scene. | ||
− | + | =Members= | |
− | {{ScriptFunction| | + | ==Miscellaneous== |
+ | {{ScriptFunction|bool|Active|{ get; set; }|Is this object Active in the scene)}} | ||
+ | {{ScriptFunction|int|Layer|{ get; set; }|Gets/Sets the object onto a particular layer (0-31)}} | ||
+ | {{ScriptFunction|string|Tag|{ get; }|Gets this objects Tag}} | ||
+ | {{ScriptFunction|string|Name|{ get; set; }|Gets/sets the name of this object}} | ||
{{ScriptFunction|bool|Exists|{ get; }|Does this object still exist in the scene (returns false if the object has been deleted via Destroy();)}} | {{ScriptFunction|bool|Exists|{ get; }|Does this object still exist in the scene (returns false if the object has been deleted via Destroy();)}} | ||
{{ScriptFunction|SGameObject|Duplicate|();|Copies the object and returns a reference to the copy. Equivalent to calling Instantiate() in Unity}} | {{ScriptFunction|SGameObject|Duplicate|();|Copies the object and returns a reference to the copy. Equivalent to calling Instantiate() in Unity}} | ||
+ | {{ScriptFunction|void|Destroy|();|Schedules this object for deletion at the end of the frame}} | ||
+ | ==Components== | ||
{{ScriptFunction|SLight|Light|{ get; }|Returns a reference to a Light component on the object. Will return null if it does not exist.}} | {{ScriptFunction|SLight|Light|{ get; }|Returns a reference to a Light component on the object. Will return null if it does not exist.}} | ||
{{ScriptFunction|SAnimator|Animator|{ get; }|Returns a reference to a Animator component on the object. Will return null if it does not exist.}} | {{ScriptFunction|SAnimator|Animator|{ get; }|Returns a reference to a Animator component on the object. Will return null if it does not exist.}} | ||
Line 11: | Line 17: | ||
{{ScriptFunction|SRigidbody|Rigidbody|{ get; }|Returns a reference to a Rigidbody component on the object. Will return null if it does not exist.}} | {{ScriptFunction|SRigidbody|Rigidbody|{ get; }|Returns a reference to a Rigidbody component on the object. Will return null if it does not exist.}} | ||
{{ScriptFunction|SUIText|UIText|{ get; }|Returns a reference to a UI.Text component on the object. Will return null if it does not exist.}} | {{ScriptFunction|SUIText|UIText|{ get; }|Returns a reference to a UI.Text component on the object. Will return null if it does not exist.}} | ||
+ | ==Events== | ||
+ | {{ScriptFunction|void|SubscribeToEvents|();|Causes this script to start listening to events on the object. Only use if you need to.}} | ||
{{ScriptFunction|void|OnAwake|(Action callback)|Binds a event to the Awake() event. Requires SubscribeToEvents be called first.}} | {{ScriptFunction|void|OnAwake|(Action callback)|Binds a event to the Awake() event. Requires SubscribeToEvents be called first.}} | ||
{{ScriptFunction|void|OnStart|(Action callback)|Binds a event to the Start() event. Requires SubscribeToEvents be called first.}} | {{ScriptFunction|void|OnStart|(Action callback)|Binds a event to the Start() event. Requires SubscribeToEvents be called first.}} | ||
Line 19: | Line 27: | ||
{{ScriptFunction|void|OnUpdate|(Action callback)|Binds a event to the OnUpdate() event. Requires SubscribeToEvents be called first.}} | {{ScriptFunction|void|OnUpdate|(Action callback)|Binds a event to the OnUpdate() event. Requires SubscribeToEvents be called first.}} | ||
{{ScriptFunction|void|OnMouseDown|(Action callback)|Binds a event to the OnMouseDown() event. Requires SubscribeToEvents be called first.}} | {{ScriptFunction|void|OnMouseDown|(Action callback)|Binds a event to the OnMouseDown() event. Requires SubscribeToEvents be called first.}} | ||
− | + | ==Hierarchy== | |
− | + | ||
− | + | ||
− | + | ||
{{ScriptFunction|SGameObject|Parent|{ get; set; }|Gets/sets the parent GameObject of this object. Assign nil/null to set this as the root.}} | {{ScriptFunction|SGameObject|Parent|{ get; set; }|Gets/sets the parent GameObject of this object. Assign nil/null to set this as the root.}} | ||
{{ScriptFunction|SGameObject|Root|{ get; }|Gets the root of this object group - may be this object.}} | {{ScriptFunction|SGameObject|Root|{ get; }|Gets the root of this object group - may be this object.}} | ||
{{ScriptFunction|SGameObject|Children[]|{ get; }|Returns the list of direct children of this object}} | {{ScriptFunction|SGameObject|Children[]|{ get; }|Returns the list of direct children of this object}} | ||
+ | ==Transform== | ||
{{ScriptFunction|SVector|WorldPosition|{ get; set; }|Gets or sets the current position of this object relative to the scene}} | {{ScriptFunction|SVector|WorldPosition|{ get; set; }|Gets or sets the current position of this object relative to the scene}} | ||
{{ScriptFunction|SVector|LocalPosition|{ get; set; }|Gets or sets the current position of this object relative to the objects parent, taking into account local position/scale/rotation}} | {{ScriptFunction|SVector|LocalPosition|{ get; set; }|Gets or sets the current position of this object relative to the objects parent, taking into account local position/scale/rotation}} | ||
Line 35: | Line 41: | ||
{{ScriptFunction|SVector|Up|{ get; }|Returns the up direction vector of this game object (green arrow)}} | {{ScriptFunction|SVector|Up|{ get; }|Returns the up direction vector of this game object (green arrow)}} | ||
{{ScriptFunction|SVector|Right|{ get; }|Returns the right direction vector of this game object (red arrow)}} | {{ScriptFunction|SVector|Right|{ get; }|Returns the right direction vector of this game object (red arrow)}} | ||
− | |||
{{Scripting Navbox}} | {{Scripting Navbox}} |
The SGameObject class refers a single Game Object active within the scene.
Is this object Active in the scene)
Gets/Sets the object onto a particular layer (0-31)
Gets this objects Tag
Gets/sets the name of this object
Does this object still exist in the scene (returns false if the object has been deleted via Destroy();)
Copies the object and returns a reference to the copy. Equivalent to calling Instantiate() in Unity
Schedules this object for deletion at the end of the frame
Returns a reference to a Light component on the object. Will return null if it does not exist.
Returns a reference to a Animator component on the object. Will return null if it does not exist.
Returns a reference to a AudioSource component on the object. Will return null if it does not exist.
Returns a reference to a Renderer component on the object. Will return null if it does not exist.
Returns a reference to a Rigidbody component on the object. Will return null if it does not exist.
Returns a reference to a UI.Text component on the object. Will return null if it does not exist.
Causes this script to start listening to events on the object. Only use if you need to.
Binds a event to the Awake() event. Requires SubscribeToEvents be called first.
Binds a event to the Start() event. Requires SubscribeToEvents be called first.
Binds a event to the OnEnable() event. Requires SubscribeToEvents be called first.
Binds a event to the OnDisable() event. Requires SubscribeToEvents be called first.
Binds a event to the OnFixedUpdate() event. Requires SubscribeToEvents be called first.
Binds a event to the OnLateUpdate() event. Requires SubscribeToEvents be called first.
Binds a event to the OnUpdate() event. Requires SubscribeToEvents be called first.
Binds a event to the OnMouseDown() event. Requires SubscribeToEvents be called first.
Gets/sets the parent GameObject of this object. Assign nil/null to set this as the root.
Gets the root of this object group - may be this object.
Returns the list of direct children of this object
Gets or sets the current position of this object relative to the scene
Gets or sets the current position of this object relative to the objects parent, taking into account local position/scale/rotation
Gets or sets the current rotation of this object relative to the scene
Gets or sets the current rotation of this object relative to the parent object
Gets or sets the current scale of this object relative to the parent
Gets the current scale of this object relative to the scene
Returns the forward direction vector of this game object (blue arrow)
Returns the up direction vector of this game object (green arrow)
Returns the right direction vector of this game object (red arrow)
|