SGameObject
في هذا الصنفSubscribeToEvents
- الدوال
- 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 - الخصائص
- 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
| دالة | SubscribeToEvents | Causes this script to start listening to events on the object. |
| دالة | SetSiblingIndex | Sets the sibling index. |
| دالة | SetAsFirstSibling | This GameObject becomes the first Sibling |
| دالة | SetAsLastSibling | This GameObject becomes the last Sibling |
| دالة | Duplicate | Copies the object and returns a reference to the copy. |
| دالة | Instantiate | Copy of Duplicate() for convenience |
| دالة | AddHingeJoint | Adds a Hinge Joint component to this Game Object and returns its reference |
| دالة | AddLight | Adds a Light component to the object. |
| دالة | AddAnimator | Adds an Animator component to this Game Object and returns its reference |
| دالة | AddAudioSource | Adds an AudioSource component to the object. |
| دالة | AddClickable | Adds a Clickable component to the object. |
| دالة | GetScript | Returns a Scripting Runtime component attached to this object by Component Name, or nil if none exist |
| دالة | GetScriptsInChildren | Returns Scripting Runtime components attached to this object by Component Name or its children |
| دالة | GetScriptInChildren | Returns a Scripting Runtime component attached to this object or its children by Component Name, or nil if none exist |
| دالة | GetScriptInParent | Returns a Scripting Runtime component attached to this object or its parents by Component Name, or nil if none exist |
| دالة | GetEvents | – |
| دالة | GetAllEventsInChildren | – |
| دالة | GetEventsInChildren | – |
| دالة | GetEventsInParent | – |
| دالة | GetResources | – |
| دالة | GetAllResourcesInChildren | – |
| دالة | GetResourcesInChildren | – |
| دالة | GetResourcesInParent | – |
| دالة | GetData | Returns a Scripting Data component attached to this object by Component Name, or nil if none exist |
| دالة | GetAllDataInChildren | Returns Scripting Data components attached to this object by Component Name or its children |
| دالة | GetDataInChildren | Returns a Scripting Data component attached to this object or its children by Component Name, or nil if none exist |
| دالة | GetDataInParent | Returns a Scripting Data component attached to this object or its parents by Component Name, or nil if none exist |
| دالة | AddRigidbody | Adds a Rigidbody component to the object. |
| دالة | AddNavMeshAgent | Adds a NavMeshAgent component to the object. |
| دالة | AddSeat | Adds a Seat component to the object. |
| دالة | OnAwake | Binds a event to the Awake() event. |
| دالة | OnStart | Binds a event to the Start() event. |
| دالة | OnEnable | Binds a event to the OnEnable() event. |
| دالة | OnDisable | Binds a event to the OnDisable() event. |
| دالة | OnFixedUpdate | Binds a event to the OnFixedUpdate() event. |
| دالة | OnLateUpdate | Binds a event to the OnLateUpdate() event. |
| دالة | OnTriggerStart | When a GameObject collides with another GameObject, Unity calls OnTriggerEnter. |
| دالة | OnTriggerStay | OnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. |
| دالة | OnTriggerExit | OnTriggerExit is called when the Collider other has stopped touching the trigger. |
| دالة | OnCollisionEnter | OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. |
| دالة | OnCollisionStay | OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider. |
| دالة | OnCollisionExit | OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider. |
| دالة | OnParticleCollision | OnParticleCollision is called when a particle hits a Collider. |
| دالة | OnParticleTrigger | Binds a new event handler for the OnParticleTrigger event. |
| دالة | OnUpdate | Binds a event to the OnUpdate() event. |
| دالة | OnMouseDown | Binds a event to the OnMouseDown() event. |
| دالة | OnApplicationQuit | Binds a new event handler for the On Application Quit event |
| دالة | CompareTag | – |
| دالة | SetParent | Make this GameObject the child of GameObject 'other' |
| دالة | Find | Find and return a reference to GameObject with name 'name' |
| دالة | FindInChildren | Find and return a reference to GameObject with name 'name' including children |
| دالة | Destroy | Schedules this object for deletion at the end of the frame |
| دالة | GetComponent | – |
| خاصية | Owner | Returns the GameObject's Owner |
| خاصية | LocalID | Returns the GameObject's Local ID |
| خاصية | InventoryID | Return's the GameObject's InventoryID |
| خاصية | HasStableID | Returns true if GameObject has Stable ID |
| خاصية | GlobalID | Returns the global ID of the GameObject |
| خاصية | Exists | Does this object still exist in the scene (returns false if the object has been deleted via Destroy();) |
| خاصية | HingeJoint | Returns a HingeJoint component attached to this object, or nil if none exist |
| خاصية | Light | Returns a reference to a Light component on the object. |
| خاصية | ReflectionProbe | Returns a ReflectionProbe component attached to this object, or nil if none exist |
| خاصية | LightInChild | Returns a Light component attached to this object or its children, or nil if none exist |
| خاصية | LightInParent | Returns a Light component attached to this object or it's parent, or nil if none exist |
| خاصية | Animator | Returns a reference to a Animator component on the object. |
| خاصية | 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 |
| خاصية | CanvasGroup | Returns Canvas Group component attached to this object, or nil if none exist |
| خاصية | Audio | Returns a reference to a AudioSource component on the object. |
| خاصية | Floor | Returns a RoomFloor component attached to this object, or nil if none exist |
| خاصية | VoiceZone | Returns a VoiceZone component attached to this object, or nil if none exist |
| خاصية | Browser | Returns a reference to a BrowserSurface component on the object. |
| خاصية | Director | Returns a PlayableDirector component attached to this object, or nil if none exist |
| خاصية | Renderer | Returns a reference to a Renderer component on the object. |
| خاصية | Vehicle | Returns a Modular Vehicle component attached to this object, or nil if none exist |
| خاصية | PostProcessVolume | Returns a Post Process Volume component attached to this object, or nil if none exist |
| خاصية | Archimatix | Returns a Archimatix Model ("AXModel" component) - or Nil if nothing exists |
| خاصية | Clickable | Returns a reference to a Clickable component on the object. |
| خاصية | EmbeddedVideo | Returns an Embedded Video component attached to this object, or nil if none exist (may not work within editor) |
| خاصية | Avatar | A reference to an Avatar component on the GameObject. |
| خاصية | AvatarAppearance | Returns a AvatarAppearance component attached to this object, or nil if none exist |
| خاصية | Script | Returns a Scripting Runtime component attached to this object, or nil if none exist |
| خاصية | StateMachine | Returns a State Machine component attached to this object, or nil if none exist |
| خاصية | Networking | Returns a Simple Networking component attached to this object, or nil if none exists |
| خاصية | Events | – |
| خاصية | Resources | – |
| خاصية | Data | Returns a Scripting Data component attached to this object, or nil if none exist |
| خاصية | Rigidbody | Returns a reference to a Rigidbody component on the object. |
| خاصية | Collider | Returns a reference to a Collider component on the object. |
| خاصية | BoxCollider | Returns a Box Collider component attached to this object, or nil if none exist |
| خاصية | SphereCollider | Returns a Sphere Collider component attached to this object, or nil if none exist |
| خاصية | CapsuleCollider | Returns a Capsule Collider component attached to this object, or nil if none exist |
| خاصية | WheelCollider | Returns a WheelCollider component attached to this object, or nil if none exist |
| خاصية | CharacterController | Returns a Character Controller component attached to this object, or nil if none exist |
| خاصية | AudioReactive | Returns the first Audio Reactive component attached to this object, or nil if none exist |
| خاصية | AttachmentHelper | Returns the first Attachment Helper component attached to this object, or nil if none exist |
| خاصية | AudioReactiveAnimation | Returns the first Audio Reactive Animation component attached to this object, or nil if none exist |
| خاصية | AudioReactiveLight | Returns the first Audio Reactive Light component attached to this object, or nil if none exist |
| خاصية | AudioReactiveParticleSystem | Returns the first Audio Reactive Particle System component attached to this object, or nil if none exist |
| خاصية | AudioReactiveMaterial | Returns the first Audio Reactive Material component attached to this object, or nil if none exist |
| خاصية | AudioReactiveTransform | Returns the first Audio Reactive Transform component attached to this object, or nil if none exist |
| خاصية | TrailRenderer | Returns a Trail Renderer component attached to this object, or nil if none exist |
| خاصية | LineRenderer | Returns a Line Renderer component attached to this object, or nil if none exist |
| خاصية | UILayout | Returns a Renderer component attached to this object, or nil if none exist |
| خاصية | UIToggle | Returns a Unity uGUI Toggle component attached to this object, or nil if none exist |
| خاصية | UIDropdown | Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist |
| خاصية | UIButton | Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist |
| خاصية | UIText | Returns a reference to a UI.Text component on the object. |
| خاصية | UISlider | Returns a Unity uGUI Slider component attached to this object, or nil if none exist |
| خاصية | UIScrollbar | Returns a Unity uGUI Scrollbar component attached to this object, or nil if none exist |
| خاصية | UICanvas | Returns a Unity uGUI Canvas component attached to this object, or nil if none exist |
| خاصية | UIImage | Returns a Unity uGUI Image component attached to this object, or nil if none exist |
| خاصية | UIRawImage | Returns a Unity uGUI Text component attached to this object, or nil if none exist |
| خاصية | UIInputField | Returns a Unity uGUI Text component attached to this object, or nil if none exist |
| خاصية | UIToolTipHint | – |
| خاصية | Camera | – |
| خاصية | VirtualCamera | Returns a VirtualCamera component attached to this object, or nil if none exists |
| خاصية | Cloth | Returns a Cloth component attached to this object, or nil if none exists |
| خاصية | MeshRenderer | Returns a MeshRenderer component attached to this object, or nil if none exists |
| خاصية | Furniture | Returns a Furniture component attached to this object, or nil if none exists |
| خاصية | NavMeshAgent | Adds a NavMeshAgent component to the object. |
| خاصية | NavMeshObstacle | Returns a NavMeshObstacle component attached to this object, or nil if none exists |
| خاصية | ParticleSystem | Returns a ParticleSystem component attached to this object, or nil if none exists |
| خاصية | RectTransform | Returns a RectTransform component attached to this object, or nil if none exists |
| خاصية | Seat | Returns a reference to a Seat component on the object. |
| خاصية | SkinnedMeshRenderer | Returns a SkinnedMeshRenderer component attached to this object, or nil if none exists |
| خاصية | Radio | Returns a SceneBackgroundMusic component attached to this object, or nil if none exists |
| خاصية | Terrain | Returns a Terrain component attached to this object, or nil if none exists |
| خاصية | AnalyticsEvent | – |
| خاصية | GraphicRaycaster | – |
| خاصية | ContentSizeFitter | – |
| خاصية | Active | Is this object Active in the scene |
| خاصية | ActiveSelf | Returns true if GameObject is Active (even if it's parent is not active) |
| خاصية | Layer | Gets/Sets the object onto a particular layer (0-31) |
| خاصية | Tag | Gets this objects Tag |
| خاصية | Name | Gets/sets the name of this object |
| خاصية | Moniker | – |
| خاصية | Parent | Gets/sets the parent GameObject of this object. |
| خاصية | Root | Gets the root of this object group - may be this object. |
| خاصية | Children | Returns the list of direct children of this object. |
| خاصية | WorldPosition | Gets or sets the current position of this object relative to the scene |
| خاصية | LocalPosition | Gets or sets the current position of this object relative to the objects parent, taking into account local position/scale/rotation |
| خاصية | WorldRotation | Gets or sets the current rotation of this object relative to the scene |
| خاصية | LocalRotation | Gets or sets the current rotation of this object relative to the parent object |
| خاصية | LocalScale | Gets or sets the current scale of this object relative to the parent |
| خاصية | WorldScale | Gets the current scale of this object relative to the scene |
| خاصية | Forward | Returns the forward direction vector of this game object (blue arrow) |
| خاصية | Up | Returns the up direction vector of this game object (green arrow) |
| خاصية | Right | Returns the right direction vector of this game object (red arrow) |
| خاصية | EventCalendar | Returns an EventCalendar component attached to this object, or nil if none exists |
الدوال
SubscribeToEvents
Causes this script to start listening to events on the object.
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| newIndex | int | – |
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.SetSiblingIndex(2)
SetAsFirstSibling
This GameObject becomes the first Sibling
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.SetAsFirstSibling()
SetAsLastSibling
This GameObject becomes the last Sibling
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.SetAsLastSibling()
Duplicate
Copies the object and returns a reference to the copy. Equivalent to calling Instantiate() in Unity
القيم المرجعة
SGameObject
مثال
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
القيم المرجعة
SGameObject
مثال
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
القيم المرجعة
SHingeJoint
مثال
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.
القيم المرجعة
SLight
مثال
newLightComponent = Space.Host.ExecutingObject.AddLight()
AddAnimator
Adds an Animator component to this Game Object and returns its reference
القيم المرجعة
SAnimator
مثال
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.
القيم المرجعة
SAudioSource
مثال
newAudioSourceComponent = Space.Host.ExecutingObject.AddAudioSource()
AddClickable
Adds a Clickable component to the object.
القيم المرجعة
SClickable
مثال
newClikcableComponent = Space.Host.ExecutingObject.AddClickable()
GetScript
Returns a Scripting Runtime component attached to this object by Component Name, or nil if none exist
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SScriptingRuntime
مثال
scriptingRuntime = Space.Host.ExecutingObject.GetScript("scriptingruntimecomponentname")
GetScriptsInChildren
Returns Scripting Runtime components attached to this object by Component Name or its children
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
القيم المرجعة
List< SScriptingRuntime >
مثال
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
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
القيم المرجعة
SScriptingRuntime
مثال
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
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SScriptingRuntime
مثال
scriptingRuntimeInParent = Space.Host.ExecutingObject.GetScript("scriptingruntimecomponentname")
GetEvents
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SScriptingEvents
مثال
scriptingEvent = Space.Host.ExecutingObject.GetEvents('ScriptingEventsComponentName')
GetAllEventsInChildren
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
القيم المرجعة
List< SScriptingEvents >
مثال
tableScriptingEvent = Space.Host.ExecutingObject.GetAllEventsInChildren
GetEventsInChildren
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
القيم المرجعة
SScriptingEvents
مثال
scriptingEvent = Space.Host.ExecutingObject.GetEventsInChildren('ScriptingEventsComponentName')
--or
scriptingEvent = Space.Host.ExecutingObject.GetEventsInChildren('ScriptingEventsComponentName', true)
GetEventsInParent
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SScriptingEvents
مثال
scriptingEvent = Space.Host.ExecutingObject.GetEventsInParent('ScriptingEventsComponentName')
GetResources
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SScriptingResources
مثال
Space.Host.ExecutingObject.GetResources('ResourcesComponentName')
GetAllResourcesInChildren
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
القيم المرجعة
List< SScriptingResources >
مثال
tableScriptingResources = Space.Host.ExecutingObject.GetAllResourcesInChildren('ScriptingResourcesComponentName')
--or
tableScriptingResources = Space.Host.ExecutingObject.GetAllResourcesInChildren('ScriptingResourcesComponentName', true)
GetResourcesInChildren
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
القيم المرجعة
SScriptingResources
مثال
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInChildren('ScriptingResourcesComponentName')
--or
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInChildren('ScriptingResourcesComponentName', true)
GetResourcesInParent
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SScriptingResources
مثال
tableScriptingResources = Space.Host.ExecutingObject.GetResourcesInParent('ScriptingResourcesComponentName')
GetData
Returns a Scripting Data component attached to this object by Component Name, or nil if none exist
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SScriptingData
مثال
scriptingData = Space.Host.ExecutingObject.GetData("scriptingdatacomponentname")
GetAllDataInChildren
Returns Scripting Data components attached to this object by Component Name or its children
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
القيم المرجعة
List< SScriptingData >
مثال
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
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| includeInactive | bool | false |
القيم المرجعة
SScriptingData
مثال
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
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SScriptingData
مثال
scriptingDataInParent = Space.Host.ExecutingObject.GetDataInParent("scriptingdatacomponentname")
AddRigidbody
Adds a Rigidbody component to the object.
القيم المرجعة
SRigidbody
مثال
newRigibodyComponent = Space.Host.ExecutingObject.AddRigidbody()
AddNavMeshAgent
Adds a NavMeshAgent component to the object.
القيم المرجعة
SNavMeshAgent
مثال
newNavMeshAgentComponent = Space.Host.ExecutingObject.AddNavMeshAgent()
AddSeat
Adds a Seat component to the object.
القيم المرجعة
SSeat
مثال
newSeatComponent = Space.Host.ExecutingObject.AddSeat()
OnAwake
Binds a event to the Awake() event.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnAwake(F)
OnStart
Binds a event to the Start() event.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnStart(F)
OnEnable
Binds a event to the OnEnable() event.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnEnable(F)
OnDisable
Binds a event to the OnDisable() event.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnDisable(F)
OnFixedUpdate
Binds a event to the OnFixedUpdate() event.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Action< SGameObject > | – |
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Action< SGameObject > | – |
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Action< SGameObject > | – |
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Action< SPhysicsHit > | – |
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Action< SPhysicsHit > | – |
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Action< SPhysicsHit > | – |
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Action< SGameObject > | – |
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
this = Space.Host.ExecutingObject
OnParticleTrigger = function(GameObject)
Space.Log("Particle Trigger Event")
end
this.OnParticleTrigger(OnParticleTrigger)
OnUpdate
Binds a event to the OnUpdate() event.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
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.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
function F()
Space.Log("bound")
end
Space.Host.ExecutingObject.OnMouseDown(F)
OnApplicationQuit
Binds a new event handler for the On Application Quit event
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| e | Closure | – |
القيم المرجعة
void
مثال
this = Space.Host.ExecutingObject
OnApplicationQuit = function()
Space.Log("Application Quit")
end
this.OnApplicationQuit(OnApplicationQuit)
CompareTag
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| tag | string | – |
القيم المرجعة
bool
مثال
isSame = Space.Host.ExecutingObject.CompareTag('tagname')
SetParent
Make this GameObject the child of GameObject 'other'
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| other | SGameObject | – |
| worldPositionStays | bool | true |
القيم المرجعة
void
مثال
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'
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SGameObject
مثال
FoundObject = Space.Host.ExecutingObject.Find("GameObject Name")
FindInChildren
Find and return a reference to GameObject with name 'name' including children
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SGameObject
مثال
FoundObjectInChildren = Space.Host.ExecutingObject.FindInChildren("GameObject Name")
Destroy
Schedules this object for deletion at the end of the frame
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.Destroy()
GetComponent
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SComponent
الخصائص
Ownerللقراءة فقط
Returns the GameObject's Owner
مثال
Owner = Space.Host.ExecutingObject.Owner
LocalIDللقراءة فقط
Returns the GameObject's Local ID
مثال
LocalID = Space.Host.ExecutingObject.LocalID
InventoryIDللقراءة فقط
Return's the GameObject's InventoryID
مثال
InventoryID = Space.Host.ExecutingObject.InventoryID
HasStableIDللقراءة فقط
Returns true if GameObject has Stable ID
مثال
HasStableID = Space.Host.ExecutingObject.HasStableID
GlobalIDللقراءة فقط
Returns the global ID of the GameObject
مثال
GlobalID = Space.Host.ExecutingObject.GlobalID
Existsللقراءة فقط
Does this object still exist in the scene (returns false if the object has been deleted via Destroy();)
مثال
doesExist = Space.Host.ExecutingObject.Exists
HingeJointللقراءة فقط
Returns a HingeJoint component attached to this object, or nil if none exist
مثال
HingeJoint = Space.Host.ExecutingObject.HingeJoint
Lightللقراءة فقط
Returns a reference to a Light component on the object. Will return null if it does not exist.
مثال
newLightComponent = Space.Host.ExecutingObject.Light
ReflectionProbeللقراءة فقط
Returns a ReflectionProbe component attached to this object, or nil if none exist
مثال
ReflectionProbe = Space.Host.ExecutingObject.ReflectionProbe
LightInChildللقراءة فقط
Returns a Light component attached to this object or its children, or nil if none exist
مثال
LightInChild = Space.Host.ExecutingObject.LightInChild
LightInParentللقراءة فقط
Returns a Light component attached to this object or it's parent, or nil if none exist
مثال
LightInParent = Space.Host.ExecutingObject.LightInParent
Animatorللقراءة فقط
Returns a reference to a Animator component on the object. Will return null if it does not exist.
مثال
animatorComponent = Space.Host.ExecutingObject.Animator
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
مثال
Animation = Space.Host.ExecutingObject.Animation
CanvasGroupللقراءة فقط
Returns Canvas Group component attached to this object, or nil if none exist
مثال
CanvasGroup = Space.Host.ExecutingObject.CanvasGroup
Audioللقراءة فقط
Returns a reference to a AudioSource component on the object. Will return null if it does not exist.
مثال
newAudioComponent = Space.Host.ExecutingObject.Audio
Floorللقراءة فقط
Returns a RoomFloor component attached to this object, or nil if none exist
مثال
Floor = Space.Host.ExecutingObject.Floor
VoiceZoneللقراءة فقط
Returns a VoiceZone component attached to this object, or nil if none exist
مثال
VoiceZone = Space.Host.ExecutingObject.VoiceZone
Browserللقراءة فقط
Returns a reference to a BrowserSurface component on the object. Will return null if it does not exist.
مثال
newBrowserComponent = Space.Host.ExecutingObject.Browser
Directorللقراءة فقط
Returns a PlayableDirector component attached to this object, or nil if none exist
مثال
Director = Space.Host.ExecutingObject.Director
Rendererللقراءة فقط
Returns a reference to a Renderer component on the object. Will return null if it does not exist.
مثال
renderer = Space.Host.ExecutingObject.Renderer
Vehicleللقراءة فقط
Returns a Modular Vehicle component attached to this object, or nil if none exist
مثال
Vehicle = Space.Host.ExecutingObject.Vehicle
PostProcessVolumeللقراءة فقط
Returns a Post Process Volume component attached to this object, or nil if none exist
مثال
PostProcessVolume = Space.Host.ExecutingObject.PostProcessVolume
Archimatixللقراءة فقط
Returns a Archimatix Model ("AXModel" component) - or Nil if nothing exists
مثال
Archimatix = Space.Host.ExecutingObject.Archimatix
Clickableللقراءة فقط
Returns a reference to a Clickable component on the object. Will return null if it does not exist.
مثال
clickableComponent = Space.Host.ExecutingObject.Clickable
EmbeddedVideoللقراءة فقط
Returns an Embedded Video component attached to this object, or nil if none exist (may not work within editor)
مثال
EmbeddedVideo = Space.Host.ExecutingObject.EmbeddedVideo
Avatarللقراءة فقط
A reference to an Avatar component on the GameObject.
مثال
Avatar = Space.Host.ExecutingObject.Avatar
AvatarAppearanceللقراءة فقط
Returns a AvatarAppearance component attached to this object, or nil if none exist
مثال
AvatarAppearance = Space.Host.ExecutingObject.AvatarAppearance
Scriptللقراءة فقط
Returns a Scripting Runtime component attached to this object, or nil if none exist
مثال
Script = Space.Host.ExecutingObject.Script
StateMachineللقراءة فقط
Returns a State Machine component attached to this object, or nil if none exist
مثال
StateMachine = Space.Host.ExecutingObject.StateMachine
Networkingللقراءة فقط
Returns a Simple Networking component attached to this object, or nil if none exists
مثال
SimpleNetworking = Space.Host.ExecutingObject.Networking
Eventsللقراءة فقط
مثال
eventsComponent = Space.Host.ExecutingObject.Events
Resourcesللقراءة فقط
مثال
resourcesComponent = Space.Host.ExecutingObject.Resources
Dataللقراءة فقط
Returns a Scripting Data component attached to this object, or nil if none exist
مثال
Data = Space.Host.ExecutingObject.Data
Rigidbodyللقراءة فقط
Returns a reference to a Rigidbody component on the object. Will return null if it does not exist.
مثال
rigidbodyComponent = Space.Host.ExecutingObject.Rigidbody
Colliderللقراءة فقط
Returns a reference to a Collider component on the object. Will return null if it does not exist.
مثال
colliderComponent = Space.Host.ExecutingObject.Collider
BoxColliderللقراءة فقط
Returns a Box Collider component attached to this object, or nil if none exist
مثال
BoxCollider = Space.Host.ExecutingObject.BoxCollider
SphereColliderللقراءة فقط
Returns a Sphere Collider component attached to this object, or nil if none exist
مثال
SphereCollider = Space.Host.ExecutingObject.SphereCollider
CapsuleColliderللقراءة فقط
Returns a Capsule Collider component attached to this object, or nil if none exist
مثال
CapsuleCollider = Space.Host.ExecutingObject.CapsuleCollider
WheelColliderللقراءة فقط
Returns a WheelCollider component attached to this object, or nil if none exist
مثال
WheelCollider = Space.Host.ExecutingObject.WheelCollider
CharacterControllerللقراءة فقط
Returns a Character Controller component attached to this object, or nil if none exist
مثال
CharacterController = Space.Host.ExecutingObject.CharacterController
AudioReactiveللقراءة فقط
Returns the first Audio Reactive component attached to this object, or nil if none exist
مثال
AudioReactive = Space.Host.ExecutingObject.AudioReactive
AttachmentHelperللقراءة فقط
Returns the first Attachment Helper component attached to this object, or nil if none exist
مثال
AttachmentHelper = Space.Host.ExecutingObject.AttachmentHelper
AudioReactiveAnimationللقراءة فقط
Returns the first Audio Reactive Animation component attached to this object, or nil if none exist
مثال
AudioReactiveAnimation = Space.Host.ExecutingObject.AudioReactiveAnimation
AudioReactiveLightللقراءة فقط
Returns the first Audio Reactive Light component attached to this object, or nil if none exist
مثال
AudioReactiveLight = Space.Host.ExecutingObject.AudioReactiveLight
AudioReactiveParticleSystemللقراءة فقط
Returns the first Audio Reactive Particle System component attached to this object, or nil if none exist
مثال
AudioReactiveParticleSystem = Space.Host.ExecutingObject.AudioReactiveParticleSystem
AudioReactiveMaterialللقراءة فقط
Returns the first Audio Reactive Material component attached to this object, or nil if none exist
مثال
AudioReactiveMaterial = Space.Host.ExecutingObject.AudioReactiveMaterial
AudioReactiveTransformللقراءة فقط
Returns the first Audio Reactive Transform component attached to this object, or nil if none exist
مثال
AudioReactiveTransform = Space.Host.ExecutingObject.AudioReactiveTransform
TrailRendererللقراءة فقط
Returns a Trail Renderer component attached to this object, or nil if none exist
مثال
TrailRenderer = Space.Host.ExecutingObject.TrailRenderer
LineRendererللقراءة فقط
Returns a Line Renderer component attached to this object, or nil if none exist
مثال
LineRenderer = Space.Host.ExecutingObject.LineRenderer
UILayoutللقراءة فقط
Returns a Renderer component attached to this object, or nil if none exist
مثال
UILayout = Space.Host.ExecutingObject.UILayout
UIToggleللقراءة فقط
Returns a Unity uGUI Toggle component attached to this object, or nil if none exist
مثال
UIToggle = Space.Host.ExecutingObject.UIToggle
UIDropdownللقراءة فقط
Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist
مثال
UIDropdown = Space.Host.ExecutingObject.UIDropdown
UIButtonللقراءة فقط
Returns a Unity uGUI Dropdown component attached to this object, or nil if none exist
مثال
UIButton = Space.Host.ExecutingObject.UIButton
UITextللقراءة فقط
Returns a reference to a UI.Text component on the object. Will return null if it does not exist.
مثال
uitext = Space.Host.ExecutingObject.UIText
UISliderللقراءة فقط
Returns a Unity uGUI Slider component attached to this object, or nil if none exist
مثال
UISlider = Space.Host.ExecutingObject.UISlider
UIScrollbarللقراءة فقط
Returns a Unity uGUI Scrollbar component attached to this object, or nil if none exist
مثال
UIScrollbar = Space.Host.ExecutingObject.UIScrollbar
UICanvasللقراءة فقط
Returns a Unity uGUI Canvas component attached to this object, or nil if none exist
مثال
UICanvas = Space.Host.ExecutingObject.UICanvas
UIImageللقراءة فقط
Returns a Unity uGUI Image component attached to this object, or nil if none exist
مثال
UIImage = Space.Host.ExecutingObject.UIImage
UIRawImageللقراءة فقط
Returns a Unity uGUI Text component attached to this object, or nil if none exist
مثال
UIRawImage = Space.Host.ExecutingObject.UIRawImage
UIInputFieldللقراءة فقط
Returns a Unity uGUI Text component attached to this object, or nil if none exist
مثال
UIInputField = Space.Host.ExecutingObject.UIInputField
UIToolTipHintللقراءة فقط
مثال
tooltipHint = Space.Host.ExecutingObject.UIToolTipHint
Cameraللقراءة فقط
مثال
camera = Space.Host.ExecutingObject.Camera
VirtualCameraللقراءة فقط
Returns a VirtualCamera component attached to this object, or nil if none exists
مثال
VirtualCamera = Space.Host.ExecutingObject.VirtualCamera
Clothللقراءة فقط
Returns a Cloth component attached to this object, or nil if none exists
مثال
Cloth = Space.Host.ExecutingObject.Cloth
MeshRendererللقراءة فقط
Returns a MeshRenderer component attached to this object, or nil if none exists
مثال
MeshRenderer = Space.Host.ExecutingObject.MeshRenderer
Furnitureللقراءة فقط
Returns a Furniture component attached to this object, or nil if none exists
مثال
Furniture = Space.Host.ExecutingObject.Furniture
NavMeshAgentللقراءة فقط
Adds a NavMeshAgent component to the object.
مثال
navMeshAgent = Space.Host.ExecutingObject.AddNavMeshAgent()
NavMeshObstacleللقراءة فقط
Returns a NavMeshObstacle component attached to this object, or nil if none exists
مثال
NavMeshObstacle = Space.Host.ExecutingObject.NavMeshObstacle
ParticleSystemللقراءة فقط
Returns a ParticleSystem component attached to this object, or nil if none exists
مثال
ParticleSystem = Space.Host.ExecutingObject.ParticleSystem
RectTransformللقراءة فقط
Returns a RectTransform component attached to this object, or nil if none exists
مثال
RectTransform = Space.Host.ExecutingObject.RectTransform
Seatللقراءة فقط
Returns a reference to a Seat component on the object. Will return null if it does not exist.
مثال
seatComponent = Space.Host.ExecutingObject.AddSeat()
SkinnedMeshRendererللقراءة فقط
Returns a SkinnedMeshRenderer component attached to this object, or nil if none exists
مثال
SkinnedMeshRenderer = Space.Host.ExecutingObject.SkinnedMeshRenderer
Radioللقراءة فقط
Returns a SceneBackgroundMusic component attached to this object, or nil if none exists
مثال
Radio = Space.Host.ExecutingObject.Radio
Terrainللقراءة فقط
Returns a Terrain component attached to this object, or nil if none exists
مثال
Terrain = Space.Host.ExecutingObject.Terrain
AnalyticsEventللقراءة فقط
مثال
analyticsEvent = Space.Host.ExecutingObject.AnalyticsEvent
GraphicRaycasterللقراءة فقط
مثال
graphicRaycaster = Space.Host.ExecutingObject.GraphicRaycaster
ContentSizeFitterللقراءة فقط
مثال
contentSzeFitter = Space.Host.ExecutingObject.ContentSizeFitter
Active
Is this object Active in the scene
مثال
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)
مثال
Space.Host.ExecutingObject.ActiveSelf = false
Layer
Gets/Sets the object onto a particular layer (0-31)
مثال
Space.Host.ExecutingObject.Layer = 21
Tagللقراءة فقط
Gets this objects Tag
مثال
objectTag = Space.Host.ExecutingObject.Tag
Name
Gets/sets the name of this object
مثال
Space.Host.ExecutingObject.Name = 'Hello World!'
Moniker
مثال
Space.Host.ExecutingObject.Moniker = 'New Moniker'
Parent
Gets/sets the parent GameObject of this object. Assign nil/null to set this as the root.
مثال
Space.Host.ExecutingObject.Parent = Space.Host.GetReference("TheOtherObject")
Rootللقراءة فقط
Gets the root of this object group - may be this object.
مثال
objectRoot = Space.Host.ExecutingObject.Root
Childrenللقراءة فقط
Returns the list of direct children of this object.
مثال
tableChildren = Space.Host.ExecutingObject.Children
WorldPosition
Gets or sets the current position of this object relative to the scene
مثال
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
مثال
Space.Host.ExecutingObject.LocalPosition = Vector.New(1,1,1)
WorldRotation
Gets or sets the current rotation of this object relative to the scene
مثال
Space.Host.ExecutingObject.WorldRotation = Quaternion.Euler(0,180,0)
LocalRotation
Gets or sets the current rotation of this object relative to the parent object
مثال
Space.Host.ExecutingObject.LocalRotation = Quaternion.Euler(0,180,0)
LocalScale
Gets or sets the current scale of this object relative to the parent
مثال
Space.Host.ExecutingObject.LocalScale = Vector.New(2,2,2)
WorldScaleللقراءة فقط
Gets the current scale of this object relative to the scene
مثال
worldScale = Space.Host.ExecutingObject.WorldScale
Forwardللقراءة فقط
Returns the forward direction vector of this game object (blue arrow)
مثال
vectorForward = Space.Host.ExecutingObject.Forward
Upللقراءة فقط
Returns the up direction vector of this game object (green arrow)
مثال
vectorUp = Space.Host.ExecutingObject.Up
Rightللقراءة فقط
Returns the right direction vector of this game object (red arrow)
مثال
vectorRight = Space.Host.ExecutingObject.Right
EventCalendarللقراءة فقط
Returns an EventCalendar component attached to this object, or nil if none exists
مثال
EventCalendar = Space.Host.ExecutingObject.EventCalendar



