Table of Contents

Class GameObject

Namespace
Crux.Core
Assembly
Crux.dll
public class GameObject
Inheritance
GameObject
Inherited Members

Constructors

GameObject(string)

public GameObject(string name)

Parameters

name string

Fields

Name

public string Name

Field Value

string

Properties

IsFrozen

public bool IsFrozen { get; }

Property Value

bool

Transform

public TransformComponent Transform { get; }

Property Value

TransformComponent

Methods

AddComponent<T>()

Adds a specified concrete type as a new component that is attached to the GameObject.

public T? AddComponent<T>() where T : Component

Returns

T

The newly created component, the existing component of the same concrete type, or null if adding the component failed.

Type Parameters

T

Remarks

Null will be returned if the GameObject contains a conflicting component.

Clone()

public GameObject Clone()

Returns

GameObject

Delete()

public void Delete()

Freeze()

public void Freeze()

GetComponent<T>()

Returns a specified concrete type if it is attached to the GameObject. A concrete type or an abstract type can be passed.

public T? GetComponent<T>() where T : Component

Returns

T

Type Parameters

T

Remarks

Null will be returned if the GameObject does not contain a concrete type that matches either the specified concrete type or a child of the specified abstract type.

HasComponentOrSibling<T>()

Returns true if the GameObject contains a concrete component that matches either the specified concrete type, a sibling of the specified concrete type, or a child of the specified abstract type.

public bool HasComponentOrSibling<T>() where T : Component

Returns

bool

Type Parameters

T

Remarks

If the specified abstract type is 'Component' then true will be returned if any concrete component exist.

HasComponent<T>()

Returns true if the GameObject contains a concrete component that matches either the specified concrete type, or a child of the specified abstract type.

public bool HasComponent<T>() where T : Component

Returns

bool

Type Parameters

T

Remarks

If the specified abstract type is 'Component' then true will be returned if any concrete component exist.

RemoveComponent<T>()

Removes a specified concrete component that is attached to the GameObject. Removes a child component if an abstract type is specified.

public void RemoveComponent<T>() where T : Component

Type Parameters

T

Remarks

Nothing will be removed if no concrete matches are found.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Unfreeze()

public void Unfreeze()

Update()

public void Update()

Events

OnFrozenStateChanged

public event Action<bool>? OnFrozenStateChanged

Event Type

Action<bool>