wiki.sine.space | sinespace

Difference between revisions of "Scripting/SGameObject"

From wiki.sine.space
Jump to: navigation, search
Line 26: Line 26:
 
{{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}}
 
+
{{ScriptFunction|SVector|WorldPosition|{ get; set; }|Gets or sets the current position of this object relative to the scene}}
'''NOTE: Set/Get World Position, Local Position, World Rotation, Local Rotation, Local Scale to be moved to properties from functions, thus not documented here.'''
+
{{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|SQuaternion|WorldRotation|{ get; set; }|Gets or sets the current rotation of this object relative to the scene}}
 +
{{ScriptFunction|SQuaternion|LocalRotation|{ get; set; }|Gets or sets the current rotation of this object relative to the parent object}}
 +
{{ScriptFunction|SQuaternion|LocalScale|{ get; set; }|Gets or sets the current scale of this object relative to the parent}}
 +
{{ScriptFunction|SQuaternion|WorldScale|{ get; }|Gets the current scale of this object relative to the scene}}
 
{{ScriptFunction|SVector|Forward|{ get; }|Returns the forward direction vector of this game object (blue arrow)}}
 
{{ScriptFunction|SVector|Forward|{ get; }|Returns the forward direction vector of this game object (blue arrow)}}
 
{{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)}}

Revision as of 08:22, 17 January 2017

The SGameObject class refers a single Game Object active within the scene.

Members

SubscribeToEvents

void SubscribeToEvents ();

Causes this script to start listening to events on the object. Only use if you need to.

No example provided yet


Exists

bool Exists { get; }

Does this object still exist in the scene (returns false if the object has been deleted via Destroy();)

No example provided yet


Duplicate

SGameObject Duplicate ();

Copies the object and returns a reference to the copy. Equivalent to calling Instantiate() in Unity

No example provided yet


Light

SLight Light { get; }

Returns a reference to a Light component on the object. Will return null if it does not exist.

No example provided yet


Animator

SAnimator Animator { get; }

Returns a reference to a Animator component on the object. Will return null if it does not exist.

No example provided yet


Audio

SAudioSource Audio { get; }

Returns a reference to a AudioSource component on the object. Will return null if it does not exist.

No example provided yet


Renderer

SRenderer Renderer { get; }

Returns a reference to a Renderer component on the object. Will return null if it does not exist.

No example provided yet


Rigidbody

SRigidbody Rigidbody { get; }

Returns a reference to a Rigidbody component on the object. Will return null if it does not exist.

No example provided yet


UIText

SUIText UIText { get; }

Returns a reference to a UI.Text component on the object. Will return null if it does not exist.

No example provided yet


OnAwake

void OnAwake (Action callback)

Binds a event to the Awake() event. Requires SubscribeToEvents be called first.

No example provided yet


OnStart

void OnStart (Action callback)

Binds a event to the Start() event. Requires SubscribeToEvents be called first.

No example provided yet


OnEnable

void OnEnable (Action callback)

Binds a event to the OnEnable() event. Requires SubscribeToEvents be called first.

No example provided yet


OnDisable

void OnDisable (Action callback)

Binds a event to the OnDisable() event. Requires SubscribeToEvents be called first.

No example provided yet


OnFixedUpdate

void OnFixedUpdate (Action callback)

Binds a event to the OnFixedUpdate() event. Requires SubscribeToEvents be called first.

No example provided yet


OnLateUpdate

void OnLateUpdate (Action callback)

Binds a event to the OnLateUpdate() event. Requires SubscribeToEvents be called first.

No example provided yet


OnUpdate

void OnUpdate (Action callback)

Binds a event to the OnUpdate() event. Requires SubscribeToEvents be called first.

No example provided yet


OnMouseDown

void OnMouseDown (Action callback)

Binds a event to the OnMouseDown() event. Requires SubscribeToEvents be called first.

No example provided yet


Active

bool Active { get; set; }

Is this object Active in the scene)

No example provided yet


Layer

int Layer { get; set; }

Gets/Sets the object onto a particular layer (0-31)

No example provided yet


Tag

string Tag { get; }

Gets this objects Tag

No example provided yet


Name

string Name { get; set; }

Gets/sets the name of this object

No example provided yet


Parent

SGameObject Parent { get; set; }

Gets/sets the parent GameObject of this object. Assign nil/null to set this as the root.

No example provided yet


Root

SGameObject Root { get; }

Gets the root of this object group - may be this object.

No example provided yet


Children[]

SGameObject Children[] { get; }

Returns the list of direct children of this object

No example provided yet


WorldPosition

SVector WorldPosition { get; set; }

Gets or sets the current position of this object relative to the scene

No example provided yet


LocalPosition

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

No example provided yet


WorldRotation

SQuaternion WorldRotation { get; set; }

Gets or sets the current rotation of this object relative to the scene

No example provided yet


LocalRotation

SQuaternion LocalRotation { get; set; }

Gets or sets the current rotation of this object relative to the parent object

No example provided yet


LocalScale

SQuaternion LocalScale { get; set; }

Gets or sets the current scale of this object relative to the parent

No example provided yet


WorldScale

SQuaternion WorldScale { get; }

Gets the current scale of this object relative to the scene

No example provided yet


Forward

SVector Forward { get; }

Returns the forward direction vector of this game object (blue arrow)

No example provided yet


Up

SVector Up { get; }

Returns the up direction vector of this game object (green arrow)

No example provided yet


Right

SVector Right { get; }

Returns the right direction vector of this game object (red arrow)

No example provided yet


Destroy

void Destroy ();

Schedules this object for deletion at the end of the frame

No example provided yet