Click or drag to resize
GameObject Class
Basic Game Object.
Inheritance Hierarchy
SystemObject
  GeonBit.ECSGameObject

Namespace:  GeonBit.ECS
Assembly:  GeonBit (in GeonBit.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class GameObject

The GameObject type exposes the following members.

Constructors
  NameDescription
Public methodGameObject
Create the game object.
Top
Properties
  NameDescription
Public propertyActiveScene
Get the currently active scene instance.
Public propertyStatic memberCount
Count how many GameObject instances currently exist. Note: 'Destroy' doesn't decrease the counter, only when the real class destrcutor is called (eg object is cleared from memory) counter is decreased.
Public propertyEnabled
Enable / disable this object. Disabled objects will not update any components and will not render.
Public propertyIsActuallyEnabled
Return true only if this GameObject and all his parents are enabled.
Public propertyIsActuallyVisible
Return true only if this GameObject and all his parents are visible.
Public propertyIsInActiveScene
Return if this object is inside the currently active scene.
Public propertyIsInScene
Get if this Game Object currently belong to any scene.
Public propertyIsRoot
Get if this game object is the root of the currently loaded scene.
Public propertyName
Object name (don't have to be unique).
Public propertyParent
Get / Set the parent of this GameObject.
Public propertyParentScene
Get the parent scene of this game object.
Public propertyPhysicalBody
An alias to get the first physical body added to this GameObject. This is useful for performance and ease of access, since Physical Body is something that you often need to access.
Public propertySceneNode
Get the scene node of this Game Object.
Public propertyVisible
Get / set object visibility. Invisible objects won't render, but will still update components.
Public propertyWasDestroyed
Get if this object was destroyed and should not be used anymore.
Top
Methods
  NameDescription
Public methodAddComponent
Add a component to this GameObject instance.
Public methodAddComponentDebug
Add a component to this GameObject instance, but only if in debug mode. If not in debug mode, will do nothing.
Public methodBeforeDraw
Called every frame to do updates right before drawing scene.
Public methodCallCollisionEnd
Called when the Game Object stop colliding with another object.
Public methodCallCollisionProcess
Called every frame while the Game Object is colliding with another object.
Public methodCallCollisionStart
Called when the Game Object start colliding with another object.
Public methodCallSpawnEvent
Spawn event is something that should be called once after the game object is ready with all components.
Public methodClone
Clone this game object.
Public methodStatic memberCreateOctree
Create an octree object with params.
Public methodDestroy
Destroy this Game Object.
Public methodDoOnUpdate
Register a function to call on every update loop. This is a quick method to add per-object functionality without defining a component type.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodFind
Find a child GameObject.
Public methodFixedUpdate
Triggers a Fixed Update event (update that happens every const amount of seconds).
Public methodGetComponentCompType
Get component by type / name.
Public methodGetComponentsCompType
Get all components by type / name.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHeartbeat
Trigger a heartbeat event.
Public methodRemoveComponent
Remove a component from this GameObject instance.
Public methodSendMessage
Invoke the 'OnReceiveMessage' callback of all the components of this entity. Note: this is used mostly for communication between user scripts.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTrigger
Iterate over all the components and call 'methodName()', if such method exists.
Public methodUpdate
Called every frame to do GameObject events.
Top
Fields
  NameDescription
Public fieldStatic memberDefaultSceneNodeType
Default scene node to use when no node type is provided in GameObject constructor.
Public fieldDisableUpdateEvents
If true, will disable update events (Update and FixedUpdate) for this game object and all its children and components. This optimization is useful for containers that hold a lot of graphic entities, but don't have any updating logic.
Public fieldHeartbeatInterval
How often, in seconds, to trigger "heartbeat" event. For example, 0.1f means heartbeat every 100 ms.
Public fieldStatic memberOctreeMaxDivisions
How many times we can divide octree nodes, until reaching the minimum bounding box size.
Public fieldStatic memberOctreeSceneBoundaries
Bounding box to use for octree culling. If you use octree culling scene node, objects that exceed this bounding box won't be culled properly.
Public fieldUpdateWhenNotVisible
If true, will call this GameObject Update() and FixedUpdate() even when not visible (outside camera / culled). If false, will not call Update() and FixedUpdate() when outside camera boundaries.
Public fieldUserData
Optional data you can attach to this game object. Note: this data will not be serialized / deserialized.
Top
See Also