Table of Contents

Class Component

Namespace
BasilEngine.Components
Assembly
BasilEngine.dll
[NativeHeader("Bindings/ManagedComponents.hpp")]
public class Component : NativeObject
Inheritance
Component
Derived
Inherited Members

Constructors

Component()

Creates a component wrapper and registers the component type with the native engine.

protected Component()

Component(ulong)

Creates a component wrapper bound to an existing native object.

protected Component(ulong handle)

Parameters

handle ulong

Native object handle.

Fields

typeID

Identifies a component type in the native engine.

protected uint typeID

Field Value

uint

Properties

Enabled

Indicates if the component is enabled and should execute in the engine.

public bool Enabled { get; set; }

Property Value

bool

gameObject

The GameObject this component is attached to.

public GameObject gameObject { get; }

Property Value

GameObject

tag

User-defined tag string.

public string tag { get; set; }

Property Value

string

transform

Cached transform for the owning game object.

public Transform transform { get; }

Property Value

Transform

Methods

DeleteComponent<T>()

public void DeleteComponent<T>() where T : Component, new()

Type Parameters

T

GetComponent<T>()

Retrieves a component of the specified type from the same game object.

public T GetComponent<T>() where T : Component, new()

Returns

T

An instance of T if found; otherwise null.

Type Parameters

T

Component type to query.

Internal_DeleteComponent(ulong, uint)

[NativeMethod("DeleteComponent")]
[StaticAccessor("ManagedComponents", StaticAccessorType.DoubleColon)]
public static extern void Internal_DeleteComponent(ulong handle, uint typeHandle)

Parameters

handle ulong
typeHandle uint

Internal_GetScriptableComponent(ulong, string)

[NativeMethod("GetManagedComponent")]
[StaticAccessor("ManagedComponents", StaticAccessorType.DoubleColon)]
public static extern object Internal_GetScriptableComponent(ulong handle, string fullName)

Parameters

handle ulong
fullName string

Returns

object

Internal_HasComponent(ulong, uint)

[NativeMethod("HasComponent")]
[StaticAccessor("ManagedComponents", StaticAccessorType.DoubleColon)]
public static extern bool Internal_HasComponent(ulong handle, uint typeHandle)

Parameters

handle ulong
typeHandle uint

Returns

bool

Internal_RegisterComponent(string)

[NativeMethod("ManagedRegisterComponent")]
[StaticAccessor("ManagedComponents", StaticAccessorType.DoubleColon)]
public static extern uint Internal_RegisterComponent(string name)

Parameters

name string

Returns

uint