SGameObject
Dans cette classeSubscribeToEvents
- Fonctions
- Subscribe
To Events - Set
Sibling Index - Set
As First Sibling - Set
As Last Sibling - Duplicate
- Instantiate
- Add
Hinge Joint - Add
Light - Add
Animator - Add
Audio Source - Add
Clickable - Get
Script - Get
Scripts In Children - Get
Script In Children - Get
Script In Parent - Get
Events - Get
All Events In Children - Get
Events In Children - Get
Events In Parent - Get
Resources - Get
All Resources In Children - Get
Resources In Children - Get
Resources In Parent - Get
Data - Get
All Data In Children - Get
Data In Children - Get
Data In Parent - Add
Rigidbody - Add
Nav Mesh Agent - Add
Seat - On
Awake - On
Start - On
Enable - On
Disable - On
Fixed Update - On
Late Update - On
Trigger Start - On
Trigger Stay - On
Trigger Exit - On
Collision Enter - On
Collision Stay - On
Collision Exit - On
Particle Collision - On
Particle Trigger - On
Update - On
Mouse Down - On
Application Quit - Compare
Tag - Set
Parent - Find
- Find
In Children - Destroy
- Get
Component - Propriétés
- Owner
- LocalID
- InventoryID
- Has
StableID - GlobalID
- Exists
- Hinge
Joint - Light
- Reflection
Probe - Light
In Child - Light
In Parent - Animator
- Animation
- Canvas
Group - Audio
- Floor
- Voice
Zone - Browser
- Director
- Renderer
- Vehicle
- Post
Process Volume - Archimatix
- Clickable
- Embedded
Video - Avatar
- Avatar
Appearance - Script
- State
Machine - Networking
- Events
- Resources
- Data
- Rigidbody
- Collider
- Box
Collider - Sphere
Collider - Capsule
Collider - Wheel
Collider - Character
Controller - Audio
Reactive - Attachment
Helper - Audio
Reactive Animation - Audio
Reactive Light - Audio
Reactive Particle System - Audio
Reactive Material - Audio
Reactive Transform - Trail
Renderer - Line
Renderer - UI
Layout - UI
Toggle - UI
Dropdown - UI
Button - UI
Text - UI
Slider - UI
Scrollbar - UI
Canvas - UI
Image - UI
Raw Image - UI
Input Field - UI
Tool Tip Hint - Camera
- Virtual
Camera - Cloth
- Mesh
Renderer - Furniture
- Nav
Mesh Agent - Nav
Mesh Obstacle - Particle
System - Rect
Transform - Seat
- Skinned
Mesh Renderer - Radio
- Terrain
- Analytics
Event - Graphic
Raycaster - Content
Size Fitter - Active
- Active
Self - Layer
- Tag
- Name
- Moniker
- Parent
- Root
- Children
- World
Position - Local
Position - World
Rotation - Local
Rotation - Local
Scale - World
Scale - Forward
- Up
- Right
- Event
Calendar
| Fonction | SubscribeToEvents | Causes this script to start listening to events on the object. |
| Fonction | SetSiblingIndex | Sets the sibling index. |
| Fonction | SetAsFirstSibling | This GameObject becomes the first Sibling |
| Fonction | SetAsLastSibling | This GameObject becomes the last Sibling |
| Fonction | Duplicate | Copies the object and returns a reference to the copy. |
| Fonction | Instantiate | Copy of Duplicate() for convenience |
| Fonction | AddHingeJoint | Adds a Hinge Joint component to this Game Object and returns its reference |
| Fonction | AddLight | Adds a Light component to the object. |
| Fonction | AddAnimator | Adds an Animator component to this Game Object and returns its reference |
| Fonction | AddAudioSource | Adds an AudioSource component to the object. |
| Fonction | AddClickable | Adds a Clickable component to the object. |
| Fonction | GetScript | Returns a Scripting Runtime component attached to this object by Component Name, or nil if none exist |
| Fonction | GetScriptsInChildren | Returns Scripting Runtime components attached to this object by Component Name or its children |
| Fonction | GetScriptInChildren | Returns a Scripting Runtime component attached to this object or its children by Component Name, or nil if none exist |
| Fonction | GetScriptInParent | Returns a Scripting Runtime component attached to this object or its parents by Component Name, or nil if none exist |
| Fonction | GetEvents | – |
| Fonction | GetAllEventsInChildren | – |
| Fonction | GetEventsInChildren | – |
| Fonction | GetEventsInParent | – |
| Fonction | GetResources | – |
| Fonction | GetAllResourcesInChildren | – |
| Fonction | GetResourcesInChildren | – |
| Fonction | GetResourcesInParent | – |
| Fonction | GetData | Returns a Scripting Data component attached to this object by Component Name, or nil if none exist |
| Fonction | GetAllDataInChildren | Returns Scripting Data components attached to this object by Component Name or its children |
| Fonction | GetDataInChildren | Returns a Scripting Data component attached to this object or its children by Component Name, or nil if none exist |
| Fonction | GetDataInParent | Returns a Scripting Data component attached to this object or its parents by Component Name, or nil if none exist |
| Fonction | AddRigidbody | Adds a Rigidbody component to the object. |
| Fonction | AddNavMeshAgent | Adds a NavMeshAgent component to the object. |
| Fonction | AddSeat | Adds a Seat component to the object. |
| Fonction | OnAwake | Binds a event to the Awake() event. |
| Fonction | OnStart | Binds a event to the Start() event. |
| Fonction | OnEnable | Binds a event to the OnEnable() event. |
| Fonction | OnDisable | Binds a event to the OnDisable() event. |
| Fonction | OnFixedUpdate | Binds a event to the OnFixedUpdate() event. |
| Fonction | OnLateUpdate | Binds a event to the OnLateUpdate() event. |
| Fonction | OnTriggerStart | When a GameObject collides with another GameObject, Unity calls OnTriggerEnter. |
| Fonction | OnTriggerStay | OnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. |
| Fonction | OnTriggerExit | OnTriggerExit is called when the Collider other has stopped touching the trigger. |
| Fonction | OnCollisionEnter | OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. |
| Fonction | OnCollisionStay | OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider. |
| Fonction | OnCollisionExit | OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider. |
| Fonction | OnParticleCollision | OnParticleCollision is called when a particle hits a Collider. |
| Fonction | OnParticleTrigger | Binds a new event handler for the OnParticleTrigger event. |
| Fonction | OnUpdate | Binds a event to the OnUpdate() event. |
| Fonction | OnMouseDown | Binds a event to the OnMouseDown() event. |
| Fonction | OnApplicationQuit | Binds a new event handler for the On Application Quit event |
| Fonction | CompareTag | – |
| Fonction | SetParent | Make this GameObject the child of GameObject 'other' |
| Fonction | Find | Find and return a reference to GameObject with name 'name' |
| Fonction | FindInChildren | Find and return a reference to GameObject with name 'name' including children |
| Fonction | Destroy | Schedules this object for deletion at the end of the frame |
| Fonction | GetComponent | – |
| Propriété | Owner | Returns the GameObject's Owner |
| Propriété | LocalID | Returns the GameObject's Local ID |
| Propriété | InventoryID | Return's the GameObject's InventoryID |
| Propriété | HasStableID | Returns true if GameObject has Stable ID |
| Propriété | GlobalID | Returns the global ID of the GameObject |
| Propriété | Exists | Does this object still exist in the scene (returns false if the object has been deleted via Destroy();) |
| Propriété | HingeJoint | Returns a HingeJoint component attached to this object, or nil if none exist |
| Propriété | Light | Returns a reference to a Light component on the object. |
| Propriété | ReflectionProbe | Returns a ReflectionProbe component attached to this object, or nil if none exist |
| Propriété | LightInChild | Returns a Light component attached to this object or its children, or nil if none exist |
| Propriété | LightInParent | Returns a Light component attached to this object or it's parent, or nil if none exist |
| Propriété | Animator | Returns a reference to a Animator component on the object. |
| Propriété | Animation | Returns an Animation component attached to this object, or nil if none exist Animation is a legacy component and should not be confused with Animator |
| Propriété | CanvasGroup | Returns Canvas Group component attached to this object, or nil if none exist |
| Propriété | Audio | Returns a reference to a AudioSource component on the object. |
| Propriété | Floor | Returns a RoomFloor component attached to this object, or nil if none exist |
| Propriété | VoiceZone | Returns a VoiceZone component attached to this object, or nil if none exist |
| Propriété | Browser | Returns a reference to a BrowserSurface component on the object. |
| Propriété | Director | Returns a PlayableDirector component attached to this object, or nil if none exist |
| Propriété | Renderer | Returns a reference to a Renderer component on the object. |
| Propriété | Vehicle | Returns a Modular Vehicle component attached to this object, or nil if none exist |
| Propriété | PostProcessVolume | Returns a Post Process Volume component attached to this object, or nil if none exist |
| Propriété | Archimatix | Returns a Archimatix Model ("AXModel" component) - or Nil if nothing exists |
| Propriété | Clickable | Returns a reference to a Clickable component on the object. |
| Propriété | EmbeddedVideo | Returns an Embedded Video component attached to this object, or nil if none exist (may not work within editor) |
| Propriété | Avatar | A reference to an Avatar component on the GameObject. |
| Propriété | AvatarAppearance | Returns a AvatarAppearance component attached to this object, or nil if none exist |
| Propriété | Script | Returns a Scripting Runtime component attached to this object, or nil if none exist |
| Propriété | StateMachine | Returns a State Machine component attached to this object, or nil if none exist |
| Propriété | Networking | Returns a Simple Networking component attached to this object, or nil if none exists |
| Propriété | Events | – |
| Propriété | Resources | – |
| Propriété | Data | Returns a Scripting Data component attached to this object, or nil if none exist |
| Propriété | Rigidbody | Returns a reference to a Rigidbody component on the object. |
| Propriété | Collider | Returns a reference to a Collider component on the object. |
| Propriété | BoxCollider | Returns a Box Collider component attached to this object, or nil if none exist |
| Propriété | SphereCollider | Returns a Sphere Collider component attached to this object, or nil if none exist |
| Propriété | CapsuleCollider | Returns a Capsule Collider component attached to this object, or nil if none exist |
| Propriété | WheelCollider | Returns a WheelCollider component attached to this object, or nil if none exist |
| Propriété | CharacterController | Returns a Character Controller component attached to this object, or nil if none exist |
| Propriété | AudioReactive | Returns the first Audio Reactive component attached to this object, or nil if none exist |
| Propriété | AttachmentHelper | Returns the first Attachment Helper component attached to this object, or nil if none exist |
| Propriété | AudioReactiveAnimation | Returns the first Audio Reactive Animation component attached to this object, or nil if none exist |
| Propriété | AudioReactiveLight | Returns the first Audio Reactive Light component attached to this object, or nil if none exist |
| Propriété | AudioReactiveParticleSystem | Returns the first Audio Reactive Particle System component attached to this object, or nil if none exist |
| Propriété | AudioReactiveMaterial | Returns the first Audio Reactive Material component attached to this object, or nil if none exist |
| Propriété | AudioReactiveTransform | Returns the first Audio Reactive Transform component attached to this object, or nil if none exist |
| Propriété | TrailRenderer | Returns a Trail Renderer component attached to this object, or nil if none exist |
| Propriété | LineRenderer | Returns a Line Renderer component attached to this object, or nil if none exist |
| Propriété | UILayout | Returns a Renderer component attached to this object, or nil if none exist |
| Propriété | UIToggle | Returns a Unity uGUI Toggle component attached to this object, or nil if none exist |
| Propriété | UIDropdown | Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist |
| Propriété | UIButton | Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist |
| Propriété | UIText | Returns a reference to a UI.Text component on the object. |
| Propriété | UISlider | Returns a Unity uGUI Slider component attached to this object, or nil if none exist |
| Propriété | UIScrollbar | Returns a Unity uGUI Scrollbar component attached to this object, or nil if none exist |
| Propriété | UICanvas | Returns a Unity uGUI Canvas component attached to this object, or nil if none exist |
| Propriété | UIImage | Returns a Unity uGUI Image component attached to this object, or nil if none exist |
| Propriété | UIRawImage | Returns a Unity uGUI Text component attached to this object, or nil if none exist |
| Propriété | UIInputField | Returns a Unity uGUI Text component attached to this object, or nil if none exist |
| Propriété | UIToolTipHint | – |
| Propriété | Camera | – |
| Propriété | VirtualCamera | Returns a VirtualCamera component attached to this object, or nil if none exists |
| Propriété | Cloth | Returns a Cloth component attached to this object, or nil if none exists |
| Propriété | MeshRenderer | Returns a MeshRenderer component attached to this object, or nil if none exists |
| Propriété | Furniture | Returns a Furniture component attached to this object, or nil if none exists |
| Propriété | NavMeshAgent | Adds a NavMeshAgent component to the object. |
| Propriété | NavMeshObstacle | Returns a NavMeshObstacle component attached to this object, or nil if none exists |
| Propriété | ParticleSystem | Returns a ParticleSystem component attached to this object, or nil if none exists |
| Propriété | RectTransform | Returns a RectTransform component attached to this object, or nil if none exists |
| Propriété | Seat | Returns a reference to a Seat component on the object. |
| Propriété | SkinnedMeshRenderer | Returns a SkinnedMeshRenderer component attached to this object, or nil if none exists |
| Propriété | Radio | Returns a SceneBackgroundMusic component attached to this object, or nil if none exists |
| Propriété | Terrain | Returns a Terrain component attached to this object, or nil if none exists |
| Propriété | AnalyticsEvent | – |
| Propriété | GraphicRaycaster | – |
| Propriété | ContentSizeFitter | – |
| Propriété | Active | Is this object Active in the scene |
| Propriété | ActiveSelf | Returns true if GameObject is Active (even if it's parent is not active) |
| Propriété | Layer | Gets/Sets the object onto a particular layer (0-31) |
| Propriété | Tag | Gets this objects Tag |
| Propriété | Name | Gets/sets the name of this object |
| Propriété | Moniker | – |
| Propriété | Parent | Gets/sets the parent GameObject of this object. |
| Propriété | Root | Gets the root of this object group - may be this object. |
| Propriété | Children | Returns the list of direct children of this object. |
| Propriété | WorldPosition | Gets or sets the current position of this object relative to the scene |
| Propriété | LocalPosition | Gets or sets the current position of this object relative to the objects parent, taking into account local position/scale/rotation |
| Propriété | WorldRotation | Gets or sets the current rotation of this object relative to the scene |
| Propriété | LocalRotation | Gets or sets the current rotation of this object relative to the parent object |
| Propriété | LocalScale | Gets or sets the current scale of this object relative to the parent |
| Propriété | WorldScale | Gets the current scale of this object relative to the scene |
| Propriété | Forward | Returns the forward direction vector of this game object (blue arrow) |
| Propriété | Up | Returns the up direction vector of this game object (green arrow) |
| Propriété | Right | Returns the right direction vector of this game object (red arrow) |
| Propriété | EventCalendar | Returns an EventCalendar component attached to this object, or nil if none exists |
Fonctions
SubscribeToEvents
Causes this script to start listening to events on the object.
Valeurs de retour
void
Exemple
Space.Host.ExecutingObject.SubscribeToEvents()
SetSiblingIndex
Sets the sibling index.
Use this to change the sibling index of the GameObject. If a GameObject shares a parent with other GameObjects and are on the same level (i.e. they share the same direct parent), these GameObjects are known as siblings. The sibling index shows where each GameObject sits in this sibling hierarchy.
Use SetSiblingIndex to change the GameObject’s place in this hierarchy. When the sibling index of a GameObject is changed, its order in the Hierarchy window will also change.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| newIndex | int | – |
Valeurs de retour
void
Exemple
Space.Host.ExecutingObject.SetSiblingIndex(2)
SetAsFirstSibling
This GameObject becomes the first Sibling
Valeurs de retour
void
Exemple
Space.Host.ExecutingObject.SetAsFirstSibling()
SetAsLastSibling
This GameObject becomes the last Sibling
Valeurs de retour
void
Exemple
Space.Host.ExecutingObject.SetAsLastSibling()
Duplicate
Copies the object and returns a reference to the copy. Equivalent to calling Instantiate() in Unity
Valeurs de retour
SGameObject
Exemple
local copy = Space.Host.ExecutingObject.Duplicate()
--this script will make this object, once clicked, duplicate itself, then the duplicate
--moves up and then duplicate itself again and the duplicate move down (total 3 vertically aligned)
--(Example: cells multiplying)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
local firstDuplicate = thisGameObject.Duplicate()
firstDuplicate.WorldPosition = firstDuplicate.WorldPosition + firstDuplicate.Up
local secondDuplicate = thisGameObject.Duplicate()
secondDuplicate.WorldPosition = secondDuplicate.WorldPosition - secondDuplicate.Up
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Click to watch me multiply "
thisGameObject.Clickable.OnClick(OnClick)
Instantiate
Copy of Duplicate() for convenience
Valeurs de retour
SGameObject
Exemple
NewGameObject = Space.Host.ExecutingObject.Instantiate()
--this script will make this object, once clicked, duplicate itself, then the duplicate
--moves up and then duplicate itself again and the duplicate move down (total 3 vertically aligned)
--(Example: cells multiplying)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
local firstDuplicate = thisGameObject.Instantiate()
firstDuplicate.WorldPosition = firstDuplicate.WorldPosition + firstDuplicate.Up
local secondDuplicate = thisGameObject.Instantiate()
secondDuplicate.WorldPosition = secondDuplicate.WorldPosition - secondDuplicate.Up
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Click to watch me multiply "
thisGameObject.Clickable.OnClick(OnClick)
AddHingeJoint
Adds a Hinge Joint component to this Game Object and returns its reference
Valeurs de retour
SHingeJoint
Exemple
NewHingeJoint = Space.Host.ExecutingObject.AddHingeJoint()
--clicking this object will add a Hinge Joint component to it at runtime
thisObject = Space.Host.ExecutingObject
OnClick = function()
HJ = thisObject.AddHingeJoint()
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
AddLight
Adds a Light component to the object.
Valeurs de retour
SLight
Exemple
newLightComponent = Space.Host.ExecutingObject.AddLight()
AddAnimator
Adds an Animator component to this Game Object and returns its reference
Valeurs de retour
SAnimator
Exemple
NewAnimator = Space.Host.ExecutingObject.AddAnimator()
--clicking this object will add an animator to it and controller at runtime
thisObject = Space.Host.ExecutingObject
theResource = Space.GetResource("An Animator Controller") -- add controller to resources in Scripting Runtime
OnClick = function()
Animator = thisObject.AddAnimator()
Animator.Controller = theResource
end
thisObject.AddClickable()
thisObject.Clickable.OnClick(OnClick)
AddAudioSource
Adds an AudioSource component to the object.
Valeurs de retour
SAudioSource
Exemple
newAudioSourceComponent = Space.Host.ExecutingObject.AddAudioSource()
AddClickable
Adds a Clickable component to the object.
Valeurs de retour
SClickable
Exemple
newClikcableComponent = Space.Host.ExecutingObject.AddClickable()
GetScript
Returns a Scripting Runtime component attached to this object by Component Name, or nil if none exist
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SScriptingRuntime
Exemple
scriptingRuntime = Space.Host.ExecutingObject.GetScript("scriptingruntimecomponentname")
GetScriptsInChildren
Returns Scripting Runtime components attached to this object by Component Name or its children
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
Valeurs de retour
List< SScriptingRuntime >
Exemple
tableScriptsInChildren = Space.Host.ExecutingObject.GetScriptsInChildren("scriptingruntimecomponentname",true)
GetScriptInChildren
Returns a Scripting Runtime component attached to this object or its children by Component Name, or nil if none exist
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
Valeurs de retour
SScriptingRuntime
Exemple
scriptingRuntimeInChildren = Space.Host.ExecutingObject.GetScriptInChildren("scriptingruntimecomponentname",true)
GetScriptInParent
Returns a Scripting Runtime component attached to this object or its parents by Component Name, or nil if none exist
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SScriptingRuntime
Exemple
scriptingRuntimeInParent = Space.Host.ExecutingObject.GetScript("scriptingruntimecomponentname")
GetEvents
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SScriptingEvents
Exemple
scriptingEvent = Space.Host.ExecutingObject.GetEvents('ScriptingEventsComponentName')
GetAllEventsInChildren
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
Valeurs de retour
List< SScriptingEvents >
Exemple
tableScriptingEvent = Space.Host.ExecutingObject.GetAllEventsInChildren
GetEventsInChildren
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
Valeurs de retour
SScriptingEvents
Exemple
scriptingEvent = Space.Host.ExecutingObject.GetEventsInChildren('ScriptingEventsComponentName')
--or
scriptingEvent = Space.Host.ExecutingObject.GetEventsInChildren('ScriptingEventsComponentName', true)
GetEventsInParent
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SScriptingEvents
Exemple
scriptingEvent = Space.Host.ExecutingObject.GetEventsInParent('ScriptingEventsComponentName')
GetResources
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SScriptingResources
Exemple
Space.Host.ExecutingObject.GetResources('ResourcesComponentName')
GetAllResourcesInChildren
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
Valeurs de retour
List< SScriptingResources >
Exemple
tableScriptingResources = Space.Host.ExecutingObject.GetAllResourcesInChildren('ScriptingResourcesComponentName')
--or
tableScriptingResources = Space.Host.ExecutingObject.GetAllResourcesInChildren('ScriptingResourcesComponentName', true)
GetResourcesInChildren
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
Valeurs de retour
SScriptingResources
Exemple
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInChildren('ScriptingResourcesComponentName')
--or
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInChildren('ScriptingResourcesComponentName', true)
GetResourcesInParent
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SScriptingResources
Exemple
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInParent('ScriptingResourcesComponentName')
GetData
Returns a Scripting Data component attached to this object by Component Name, or nil if none exist
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SScriptingData
Exemple
scriptingData = Space.Host.ExecutingObject.GetData("scriptingdatacomponentname")
GetAllDataInChildren
Returns Scripting Data components attached to this object by Component Name or its children
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
Valeurs de retour
List< SScriptingData >
Exemple
tableScriptingDataInChildren = Space.Host.ExecutingObject.GetAllDataInChildren("scriptingdatacomponentname",true)
GetDataInChildren
Returns a Scripting Data component attached to this object or its children by Component Name, or nil if none exist
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
Valeurs de retour
SScriptingData
Exemple
scriptingDataInChildren = Space.Host.ExecutingObject.GetDataInChildren("scriptingdatacomponentname",true)
GetDataInParent
Returns a Scripting Data component attached to this object or its parents by Component Name, or nil if none exist
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SScriptingData
Exemple
scriptingDataInParent = Space.Host.ExecutingObject.GetDataInParent("scriptingdatacomponentname")
AddRigidbody
Adds a Rigidbody component to the object.
Valeurs de retour
SRigidbody
Exemple
newRigibodyComponent = Space.Host.ExecutingObject.AddRigidbody()
AddNavMeshAgent
Adds a NavMeshAgent component to the object.
Valeurs de retour
SNavMeshAgent
Exemple
newNavMeshAgentComponent = Space.Host.ExecutingObject.AddNavMeshAgent()
AddSeat
Adds a Seat component to the object.
Valeurs de retour
SSeat
Exemple
newSeatComponent = Space.Host.ExecutingObject.AddSeat()
OnAwake
Binds a event to the Awake() event.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnAwake(F)
OnStart
Binds a event to the Start() event.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnStart(F)
OnEnable
Binds a event to the OnEnable() event.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnEnable(F)
OnDisable
Binds a event to the OnDisable() event.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnDisable(F)
OnFixedUpdate
Binds a event to the OnFixedUpdate() event.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnFixedUpdate(F)
--this script will make this object move forward each physics frame
thisObject = Space.Host.ExecutingObject
OnFixedUpdate = function()
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * 0.01 )
--unlike OnUpdate we did not multiply by Space.DeltaTime
--because OnFixedUpdate executes at the same rate regardless
end
thisObject.OnFixedUpdate(OnFixedUpdate)
OnLateUpdate
Binds a event to the OnLateUpdate() event.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnLateUpdate(F)
--this script will make this object move forward each frame
--but it will be last to move among other objects (read about OnLateUpdate)
--(example: camera movement)
thisObject = Space.Host.ExecutingObject
OnLateUpdate = function()
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * 0.01 * Space.DeltaTime)
--we multipy by Space.DeltaTime so that it behaves the same for all players
--even though they have different FPS (frames per second)
end
thisObject.OnLateUpdate(OnLateUpdate)
OnTriggerStart
When a GameObject collides with another GameObject, Unity calls OnTriggerEnter.
OnTriggerEnter happens on the FixedUpdate function when two GameObjects collide. The Colliders involved are not always at the point of initial contact.
Note: Both GameObjects must contain a Collider component. One must have Collider.isTrigger enabled, and contain a Rigidbody. If both GameObjects have Collider.isTrigger enabled, no collision happens. The same applies when both GameObjects do not have a Rigidbody component.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Action< SGameObject > | – |
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnTriggerStart = function(SGameObject)
Space.Log("Trigger Start")
end
this.OnTriggerStart (OnTriggerStart )
--the below scipt makes this object a boundary area where flying gets blocked
--while player is in it and flying is allowed once player leaves it
--(Example: No fly zone)
--[This object's collider needs to be set as IsTrigger (Please read about OnTriggerStart for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
OnTriggerStart = function(TriggerStarter)
if TriggerStarter.Root.Avatar ~= nil then
if TriggerStarter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockFly = true
end
end
end
OnTriggerExit = function(TriggerExiter)
if TriggerExiter.Root.Avatar ~= nil then
if TriggerExiter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockFly = false
end
end
end
thisGameObject.OnTriggerStart(OnTriggerStart)
thisGameObject.OnTriggerExit(OnTriggerExit)
OnTriggerStay
OnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. The function is on the physics timer so it won't necessarily run every frame.
This message is sent to the trigger and the collider that touches the trigger. Note that trigger events are only sent if one of the colliders also has a rigidbody attached. Trigger events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Action< SGameObject > | – |
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnTriggerStay = function(SGameObject)
Space.Log("Trigger Stay")
end
this.OnTriggerStay(OnTriggerStay)
--the below scipt makes this object a boundary area where any user entering it
--will be blocked from movement for 10 seconds, then the object will release controls and
--destry itself after that
--(Example: freezing trap)
--[This object's collider needs to be set as IsTrigger (Please read about OnTriggerStart for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
FrozenTime = 0.0
OnTriggerStart = function(TriggerStarter)
if TriggerStarter.Root.Avatar ~= nil then
if TriggerStarter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockMovement = true
end
end
end
OnTriggerStay = function(TriggerStayer)
if TriggerStayer.Root.Avatar ~= nil then
if TriggerStayer.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
FrozenTime = FrozenTime + Space.DeltaTime
if FrozenTime > 20 then
Space.Scene.PlayerAvatar.BlockMovement = false
thisGameObject.Destroy()
end
end
end
end
thisGameObject.OnTriggerStart(OnTriggerStart)
thisGameObject.OnTriggerStay(OnTriggerStay)
OnTriggerExit
OnTriggerExit is called when the Collider other has stopped touching the trigger.
This message is sent to the trigger and the Collider that touches the trigger. Notes: Trigger events are only sent if one of the Colliders also has a Rigidbody attached. Trigger events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions. OnTriggerExit occurs on the FixedUpdate after the Colliders have stopped touching. The Colliders involved are not guaranteed to be at the point of initial separation.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Action< SGameObject > | – |
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnTriggerExit = function(SGameObject)
Space.Log("Trigger Stay")
end
this.OnTriggerExit(OnTriggerExit)
--the below scipt makes this object a boundary area where flying gets blocked
--while player is in it and flying is allowed once player leaves it
--(Example: No fly zone)
--[This object's collider needs to be set as IsTrigger (Please read about OnTriggerStart for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
OnTriggerStart = function(TriggerStarter)
if TriggerStarter.Root.Avatar ~= nil then
if TriggerStarter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockFly = true
end
end
end
OnTriggerExit = function(TriggerExiter)
if TriggerExiter.Root.Avatar ~= nil then
if TriggerExiter.Root.Avatar.Username == Space.Scene.PlayerAvatar.Username then
Space.Scene.PlayerAvatar.BlockFly = false
end
end
end
thisGameObject.OnTriggerStart(OnTriggerStart)
thisGameObject.OnTriggerExit(OnTriggerExit)
OnCollisionEnter
OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider.
In contrast to OnTriggerStart, OnCollisionEnter is passed the SPhysicsHit class and not a Collider (GameObject). The SPhysicsHit class contains information, for example, about contact points and impact velocity. Notes: Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached. Collision events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Action< SPhysicsHit > | – |
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnCollisionEnter = function(SPhysicsHit)
Space.Log("Collision Enter")
end
this.OnCollisionEnter(OnCollisionEnter)
--this script will make this object delete itself if it collides with something
--(Example: grenade)
--[Make sure you add a rigibody to this object (read above about "collisions")
thisGameObject = Space.Host.ExecutingObject
OnCollisionEnter = function(SPhysicsHit)
thisGameObject.Destroy()
end
thisGameObject.OnCollisionEnter(OnCollisionEnter)
OnCollisionStay
OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider.
In contrast to OnTriggerStay, OnCollisionStay is passed the SPhysicsHit class and not a Collider (GameObject). The SPhysicsHit class contains information about contact points, impact velocity etc. If you don't use collisionInfo in the function, leave out the collisionInfo parameter as this avoids unneccessary calculations. Notes: Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached. Collision events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions. Collision stay events are not sent for sleeping Rigidbodies.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Action< SPhysicsHit > | – |
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnCollisionStay = function(SPhysicsHit)
Space.Log("Collision Stay")
end
this.OnCollisionStay(OnCollisionStay)
--this script will make this object delete itself if
--it is being touched for around 10 seconds
--(Example: a flag being captured)
--[Make sure this object has collider/rigidbody (read above about "collisions" for troubleshooting)]
thisGameObject = Space.Host.ExecutingObject
touchedTime = 0.0
OnCollisionStay = function(SPhysicsHit)
touchedTime = touchedTime + Space.DeltaTime
if touchedTime > 25 then
thisGameObject.Destroy()
end
end
thisGameObject.OnCollisionStay(OnCollisionStay)
OnCollisionExit
OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider.
In contrast to OnTriggerExit, OnCollisionExit is passed the SPhysicsHit class and not a Collider. The SPhysicsHit class contains information about contact points, impact velocity etc. If you don't use collisionInfo in the function, leave out the collisionInfo parameter as this avoids unneccessary calculations. Notes: Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached. Collision events will be sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Action< SPhysicsHit > | – |
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnCollisionExit = function(SPhysicsHit)
Space.Log("Collision Exit")
end
this.OnCollisionExit(OnCollisionExit)
--this script will make this object destroy itself when an object
--that collided with it exits the collission
--(Example: landmine)
--[Make sure you add a rigibody to this object (read above about "collisions")
thisGameObject = Space.Host.ExecutingObject
OnCollisionExit = function(SPhysicsHit)
thisGameObject.Destroy()
end
thisGameObject.OnCollisionExit(OnCollisionExit)
OnParticleCollision
OnParticleCollision is called when a particle hits a Collider.
This can be used to apply damage to a GameObject when hit by particles.
This message is sent to scripts attached to Particle Systems and to the Collider that was hit.
When OnParticleCollision is invoked from a script attached to a GameObject with a Collider, the GameObject parameter represents the ParticleSystem. The Collider receives at most one message per Particle System that collided with it in any given frame even when the Particle System struck the Collider with multiple particles in the current frame.
When OnParticleCollision is invoked from a script attached to a ParticleSystem, the GameObject parameter represents a GameObject with an attached Collider struck by the ParticleSystem. The ParticleSystem receives at most one message per Collider that is struck.
Messages are only sent if you enable Send Collision Messages in the Inspector of the Particle System Collision module.
The OnParticleCollision can be a co-routine. Simply use the yield statement in the function.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Action< SGameObject > | – |
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnParticleCollision = function(GameObject)
Space.Log("Particle Collision")
end
this.OnParticleCollision(OnParticleCollision)
OnParticleTrigger
Binds a new event handler for the OnParticleTrigger event.
OnParticleTrigger event is called when any particles in a Particle System meet the conditions in the trigger module.
This can be used to kill or modify particles that are inside or outside a collision volume.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
Space.Log("Particle Trigger Event")
end
this.OnParticleTrigger(OnParticleTrigger)
OnUpdate
Binds a event to the OnUpdate() event.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnUpdate(F)
--this script will make this object move forward each frame
thisObject = Space.Host.ExecutingObject
OnUpdate = function()
thisObject.WorldPosition = thisObject.WorldPosition + (thisObject.Forward * 0.01 * Space.DeltaTime)
--we multipy by Space.DeltaTime so that it behaves the same for all players
--even though they have different FPS (frames per second)
end
thisObject.OnUpdate(OnUpdate)
OnMouseDown
Binds a event to the OnMouseDown() event.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnMouseDown(F)
OnApplicationQuit
Binds a new event handler for the On Application Quit event
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| e | Closure | – |
Valeurs de retour
void
Exemple
this = Space.Host.ExecutingObject
OnApplicationQuit = function()
Space.Log("Application Quit")
end
this.OnApplicationQuit(OnApplicationQuit)
CompareTag
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| tag | string | – |
Valeurs de retour
bool
Exemple
isSame = Space.Host.ExecutingObject.CompareTag('tagname')
SetParent
Make this GameObject the child of GameObject 'other'
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| other | SGameObject | – |
| worldPositionStays | bool | true |
Valeurs de retour
void
Exemple
Space.Host.ExecutingObject.SetParent(otherObjectReference,true)
--this script will set your avatar's "right hand" as parent of this object
--this way this object will be a child of your right hand and therefore move with it
--(Example: clicking on a gun to equip it)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
RightHand = Space.Scene.PlayerAvatar.FindBone("RightHand")
thisGameObject.SetParent(RightHand)
thisGameObject.LocalPosition = Vector.New(0,0,0) -- resetting position to match hand
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Click to Equip "
thisGameObject.Clickable.OnClick(OnClick)
Find
Find and return a reference to GameObject with name 'name'
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SGameObject
Exemple
FoundObject = Space.Host.ExecutingObject.Find("GameObject Name")
FindInChildren
Find and return a reference to GameObject with name 'name' including children
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SGameObject
Exemple
FoundObjectInChildren = Space.Host.ExecutingObject.FindInChildren("GameObject Name")
Destroy
Schedules this object for deletion at the end of the frame
Valeurs de retour
void
Exemple
Space.Host.ExecutingObject.Destroy()
GetComponent
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SComponent
Propriétés
OwnerLecture seule
Returns the GameObject's Owner
Exemple
Owner = Space.Host.ExecutingObject.Owner
LocalIDLecture seule
Returns the GameObject's Local ID
Exemple
LocalID = Space.Host.ExecutingObject.LocalID
InventoryIDLecture seule
Return's the GameObject's InventoryID
Exemple
InventoryID = Space.Host.ExecutingObject.InventoryID
HasStableIDLecture seule
Returns true if GameObject has Stable ID
Exemple
HasStableID = Space.Host.ExecutingObject.HasStableID
GlobalIDLecture seule
Returns the global ID of the GameObject
Exemple
GlobalID = Space.Host.ExecutingObject.GlobalID
ExistsLecture seule
Does this object still exist in the scene (returns false if the object has been deleted via Destroy();)
Exemple
doesExist = Space.Host.ExecutingObject.Exists
HingeJointLecture seule
Returns a HingeJoint component attached to this object, or nil if none exist
Exemple
HingeJoint = Space.Host.ExecutingObject.HingeJoint
LightLecture seule
Returns a reference to a Light component on the object. Will return null if it does not exist.
Exemple
newLightComponent = Space.Host.ExecutingObject.Light
ReflectionProbeLecture seule
Returns a ReflectionProbe component attached to this object, or nil if none exist
Exemple
ReflectionProbe = Space.Host.ExecutingObject.ReflectionProbe
LightInChildLecture seule
Returns a Light component attached to this object or its children, or nil if none exist
Exemple
LightInChild = Space.Host.ExecutingObject.LightInChild
LightInParentLecture seule
Returns a Light component attached to this object or it's parent, or nil if none exist
Exemple
LightInParent = Space.Host.ExecutingObject.LightInParent
AnimatorLecture seule
Returns a reference to a Animator component on the object. Will return null if it does not exist.
Exemple
animatorComponent = Space.Host.ExecutingObject.Animator
AnimationLecture seule
Returns an Animation component attached to this object, or nil if none exist Animation is a legacy component and should not be confused with Animator
Exemple
Animation = Space.Host.ExecutingObject.Animation
CanvasGroupLecture seule
Returns Canvas Group component attached to this object, or nil if none exist
Exemple
CanvasGroup = Space.Host.ExecutingObject.CanvasGroup
AudioLecture seule
Returns a reference to a AudioSource component on the object. Will return null if it does not exist.
Exemple
newAudioComponent = Space.Host.ExecutingObject.Audio
FloorLecture seule
Returns a RoomFloor component attached to this object, or nil if none exist
Exemple
Floor = Space.Host.ExecutingObject.Floor
VoiceZoneLecture seule
Returns a VoiceZone component attached to this object, or nil if none exist
Exemple
VoiceZone = Space.Host.ExecutingObject.VoiceZone
BrowserLecture seule
Returns a reference to a BrowserSurface component on the object. Will return null if it does not exist.
Exemple
newBrowserComponent = Space.Host.ExecutingObject.Browser
DirectorLecture seule
Returns a PlayableDirector component attached to this object, or nil if none exist
Exemple
Director = Space.Host.ExecutingObject.Director
RendererLecture seule
Returns a reference to a Renderer component on the object. Will return null if it does not exist.
Exemple
renderer = Space.Host.ExecutingObject.Renderer
VehicleLecture seule
Returns a Modular Vehicle component attached to this object, or nil if none exist
Exemple
Vehicle = Space.Host.ExecutingObject.Vehicle
PostProcessVolumeLecture seule
Returns a Post Process Volume component attached to this object, or nil if none exist
Exemple
PostProcessVolume = Space.Host.ExecutingObject.PostProcessVolume
ArchimatixLecture seule
Returns a Archimatix Model ("AXModel" component) - or Nil if nothing exists
Exemple
Archimatix = Space.Host.ExecutingObject.Archimatix
ClickableLecture seule
Returns a reference to a Clickable component on the object. Will return null if it does not exist.
Exemple
clickableComponent = Space.Host.ExecutingObject.Clickable
EmbeddedVideoLecture seule
Returns an Embedded Video component attached to this object, or nil if none exist (may not work within editor)
Exemple
EmbeddedVideo = Space.Host.ExecutingObject.EmbeddedVideo
AvatarLecture seule
A reference to an Avatar component on the GameObject.
Exemple
Avatar = Space.Host.ExecutingObject.Avatar
AvatarAppearanceLecture seule
Returns a AvatarAppearance component attached to this object, or nil if none exist
Exemple
AvatarAppearance = Space.Host.ExecutingObject.AvatarAppearance
ScriptLecture seule
Returns a Scripting Runtime component attached to this object, or nil if none exist
Exemple
Script = Space.Host.ExecutingObject.Script
StateMachineLecture seule
Returns a State Machine component attached to this object, or nil if none exist
Exemple
StateMachine = Space.Host.ExecutingObject.StateMachine
NetworkingLecture seule
Returns a Simple Networking component attached to this object, or nil if none exists
Exemple
SimpleNetworking = Space.Host.ExecutingObject.Networking
EventsLecture seule
Exemple
eventsComponent = Space.Host.ExecutingObject.Events
ResourcesLecture seule
Exemple
resourcesComponent = Space.Host.ExecutingObject.Resources
DataLecture seule
Returns a Scripting Data component attached to this object, or nil if none exist
Exemple
Data = Space.Host.ExecutingObject.Data
RigidbodyLecture seule
Returns a reference to a Rigidbody component on the object. Will return null if it does not exist.
Exemple
rigidbodyComponent = Space.Host.ExecutingObject.Rigidbody
ColliderLecture seule
Returns a reference to a Collider component on the object. Will return null if it does not exist.
Exemple
colliderComponent = Space.Host.ExecutingObject.Collider
BoxColliderLecture seule
Returns a Box Collider component attached to this object, or nil if none exist
Exemple
BoxCollider = Space.Host.ExecutingObject.BoxCollider
SphereColliderLecture seule
Returns a Sphere Collider component attached to this object, or nil if none exist
Exemple
SphereCollider = Space.Host.ExecutingObject.SphereCollider
CapsuleColliderLecture seule
Returns a Capsule Collider component attached to this object, or nil if none exist
Exemple
CapsuleCollider = Space.Host.ExecutingObject.CapsuleCollider
WheelColliderLecture seule
Returns a WheelCollider component attached to this object, or nil if none exist
Exemple
WheelCollider = Space.Host.ExecutingObject.WheelCollider
CharacterControllerLecture seule
Returns a Character Controller component attached to this object, or nil if none exist
Exemple
CharacterController = Space.Host.ExecutingObject.CharacterController
AudioReactiveLecture seule
Returns the first Audio Reactive component attached to this object, or nil if none exist
Exemple
AudioReactive = Space.Host.ExecutingObject.AudioReactive
AttachmentHelperLecture seule
Returns the first Attachment Helper component attached to this object, or nil if none exist
Exemple
AttachmentHelper = Space.Host.ExecutingObject.AttachmentHelper
AudioReactiveAnimationLecture seule
Returns the first Audio Reactive Animation component attached to this object, or nil if none exist
Exemple
AudioReactiveAnimation = Space.Host.ExecutingObject.AudioReactiveAnimation
AudioReactiveLightLecture seule
Returns the first Audio Reactive Light component attached to this object, or nil if none exist
Exemple
AudioReactiveLight = Space.Host.ExecutingObject.AudioReactiveLight
AudioReactiveParticleSystemLecture seule
Returns the first Audio Reactive Particle System component attached to this object, or nil if none exist
Exemple
AudioReactiveParticleSystem = Space.Host.ExecutingObject.AudioReactiveParticleSystem
AudioReactiveMaterialLecture seule
Returns the first Audio Reactive Material component attached to this object, or nil if none exist
Exemple
AudioReactiveMaterial = Space.Host.ExecutingObject.AudioReactiveMaterial
AudioReactiveTransformLecture seule
Returns the first Audio Reactive Transform component attached to this object, or nil if none exist
Exemple
AudioReactiveTransform = Space.Host.ExecutingObject.AudioReactiveTransform
TrailRendererLecture seule
Returns a Trail Renderer component attached to this object, or nil if none exist
Exemple
TrailRenderer = Space.Host.ExecutingObject.TrailRenderer
LineRendererLecture seule
Returns a Line Renderer component attached to this object, or nil if none exist
Exemple
LineRenderer = Space.Host.ExecutingObject.LineRenderer
UILayoutLecture seule
Returns a Renderer component attached to this object, or nil if none exist
Exemple
UILayout = Space.Host.ExecutingObject.UILayout
UIToggleLecture seule
Returns a Unity uGUI Toggle component attached to this object, or nil if none exist
Exemple
UIToggle = Space.Host.ExecutingObject.UIToggle
UIDropdownLecture seule
Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist
Exemple
UIDropdown = Space.Host.ExecutingObject.UIDropdown
UIButtonLecture seule
Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist
Exemple
UIButton = Space.Host.ExecutingObject.UIButton
UITextLecture seule
Returns a reference to a UI.Text component on the object. Will return null if it does not exist.
Exemple
uitext = Space.Host.ExecutingObject.UIText
UISliderLecture seule
Returns a Unity uGUI Slider component attached to this object, or nil if none exist
Exemple
UISlider = Space.Host.ExecutingObject.UISlider
UIScrollbarLecture seule
Returns a Unity uGUI Scrollbar component attached to this object, or nil if none exist
Exemple
UIScrollbar = Space.Host.ExecutingObject.UIScrollbar
UICanvasLecture seule
Returns a Unity uGUI Canvas component attached to this object, or nil if none exist
Exemple
UICanvas = Space.Host.ExecutingObject.UICanvas
UIImageLecture seule
Returns a Unity uGUI Image component attached to this object, or nil if none exist
Exemple
UIImage = Space.Host.ExecutingObject.UIImage
UIRawImageLecture seule
Returns a Unity uGUI Text component attached to this object, or nil if none exist
Exemple
UIRawImage = Space.Host.ExecutingObject.UIRawImage
UIInputFieldLecture seule
Returns a Unity uGUI Text component attached to this object, or nil if none exist
Exemple
UIInputField = Space.Host.ExecutingObject.UIInputField
UIToolTipHintLecture seule
Exemple
tooltipHint = Space.Host.ExecutingObject.UIToolTipHint
CameraLecture seule
Exemple
camera = Space.Host.ExecutingObject.Camera
VirtualCameraLecture seule
Returns a VirtualCamera component attached to this object, or nil if none exists
Exemple
VirtualCamera = Space.Host.ExecutingObject.VirtualCamera
ClothLecture seule
Returns a Cloth component attached to this object, or nil if none exists
Exemple
Cloth = Space.Host.ExecutingObject.Cloth
MeshRendererLecture seule
Returns a MeshRenderer component attached to this object, or nil if none exists
Exemple
MeshRenderer = Space.Host.ExecutingObject.MeshRenderer
FurnitureLecture seule
Returns a Furniture component attached to this object, or nil if none exists
Exemple
Furniture = Space.Host.ExecutingObject.Furniture
NavMeshAgentLecture seule
Adds a NavMeshAgent component to the object.
Exemple
navMeshAgent = Space.Host.ExecutingObject.AddNavMeshAgent()
NavMeshObstacleLecture seule
Returns a NavMeshObstacle component attached to this object, or nil if none exists
Exemple
NavMeshObstacle = Space.Host.ExecutingObject.NavMeshObstacle
ParticleSystemLecture seule
Returns a ParticleSystem component attached to this object, or nil if none exists
Exemple
ParticleSystem = Space.Host.ExecutingObject.ParticleSystem
RectTransformLecture seule
Returns a RectTransform component attached to this object, or nil if none exists
Exemple
RectTransform = Space.Host.ExecutingObject.RectTransform
SeatLecture seule
Returns a reference to a Seat component on the object. Will return null if it does not exist.
Exemple
seatComponent = Space.Host.ExecutingObject.AddSeat()
SkinnedMeshRendererLecture seule
Returns a SkinnedMeshRenderer component attached to this object, or nil if none exists
Exemple
SkinnedMeshRenderer = Space.Host.ExecutingObject.SkinnedMeshRenderer
RadioLecture seule
Returns a SceneBackgroundMusic component attached to this object, or nil if none exists
Exemple
Radio = Space.Host.ExecutingObject.Radio
TerrainLecture seule
Returns a Terrain component attached to this object, or nil if none exists
Exemple
Terrain = Space.Host.ExecutingObject.Terrain
AnalyticsEventLecture seule
Exemple
analyticsEvent = Space.Host.ExecutingObject.AnalyticsEvent
GraphicRaycasterLecture seule
Exemple
graphicRaycaster = Space.Host.ExecutingObject.GraphicRaycaster
ContentSizeFitterLecture seule
Exemple
contentSzeFitter = Space.Host.ExecutingObject.ContentSizeFitter
Active
Is this object Active in the scene
Exemple
Space.Host.ExecutingObject.Active = false
--the below script will make this object become inactive
--after being being clicked
--(Example: picking up fruits)
thisGameObject = Space.Host.ExecutingObject
OnClick = function()
thisGameObject.Active = false
end
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip="Pick me!"
thisGameObject.Clickable.OnClick(OnClick)
ActiveSelf
Returns true if GameObject is Active (even if it's parent is not active)
Exemple
Space.Host.ExecutingObject.ActiveSelf = false
Layer
Gets/Sets the object onto a particular layer (0-31)
Exemple
Space.Host.ExecutingObject.Layer = 21
TagLecture seule
Gets this objects Tag
Exemple
objectTag = Space.Host.ExecutingObject.Tag
Name
Gets/sets the name of this object
Exemple
Space.Host.ExecutingObject.Name = 'Hello World!'
Moniker
Exemple
Space.Host.ExecutingObject.Moniker = 'New Moniker'
Parent
Gets/sets the parent GameObject of this object. Assign nil/null to set this as the root.
Exemple
Space.Host.ExecutingObject.Parent = Space.Host.GetReference("TheOtherObject")
RootLecture seule
Gets the root of this object group - may be this object.
Exemple
objectRoot = Space.Host.ExecutingObject.Root
ChildrenLecture seule
Returns the list of direct children of this object.
Exemple
tableChildren = Space.Host.ExecutingObject.Children
WorldPosition
Gets or sets the current position of this object relative to the scene
Exemple
Space.Host.ExecutingObject.WorldPosition = Vector.New(1,1,1)
LocalPosition
Gets or sets the current position of this object relative to the objects parent, taking into account local position/scale/rotation
Exemple
Space.Host.ExecutingObject.LocalPosition = Vector.New(1,1,1)
WorldRotation
Gets or sets the current rotation of this object relative to the scene
Exemple
Space.Host.ExecutingObject.WorldRotation = Quaternion.Euler(0,180,0)
LocalRotation
Gets or sets the current rotation of this object relative to the parent object
Exemple
Space.Host.ExecutingObject.LocalRotation = Quaternion.Euler(0,180,0)
LocalScale
Gets or sets the current scale of this object relative to the parent
Exemple
Space.Host.ExecutingObject.LocalScale = Vector.New(2,2,2)
WorldScaleLecture seule
Gets the current scale of this object relative to the scene
Exemple
worldScale = Space.Host.ExecutingObject.WorldScale
ForwardLecture seule
Returns the forward direction vector of this game object (blue arrow)
Exemple
vectorForward = Space.Host.ExecutingObject.Forward
UpLecture seule
Returns the up direction vector of this game object (green arrow)
Exemple
vectorUp = Space.Host.ExecutingObject.Up
RightLecture seule
Returns the right direction vector of this game object (red arrow)
Exemple
vectorRight = Space.Host.ExecutingObject.Right
EventCalendarLecture seule
Returns an EventCalendar component attached to this object, or nil if none exists
Exemple
EventCalendar = Space.Host.ExecutingObject.EventCalendar



