Table of Contents

Class EActor

Namespace
Exiled.API.Features.Core
Assembly
Exiled.API.dll

Actor is the base class for a EObject that can be placed or spawned in-game.

public abstract class EActor : EObject, IEntity, IWorldSpace, IPosition, IRotation
Inheritance
EActor
Implements
Derived
Inherited Members
Extension Methods

Constructors

EActor()

Initializes a new instance of the EActor class.

protected EActor()

EActor(GameObject)

Initializes a new instance of the EActor class.

protected EActor(GameObject gameObject = null)

Parameters

gameObject GameObject

The base UnityEngine.GameObject.

Fields

DefaultFixedTickRate

The default fixed tick rate.

public const float DefaultFixedTickRate = 0.016

Field Value

float

Properties

CanEverTick

Gets or sets a value indicating whether the EActor can tick.

public virtual bool CanEverTick { get; set; }

Property Value

bool

ComponentsInChildren

Gets a IReadOnlyCollection<T> of EActor containing all the components in children.

public IReadOnlyCollection<EActor> ComponentsInChildren { get; }

Property Value

IReadOnlyCollection<EActor>

ComponentsInParent

Gets a EActor[] containing all the components in parent.

protected IEnumerable<EActor> ComponentsInParent { get; }

Property Value

IEnumerable<EActor>

FixedTickRate

Gets or sets the value which determines the size of every tick.

public virtual float FixedTickRate { get; set; }

Property Value

float

Position

Gets or sets the position.

public virtual Vector3 Position { get; set; }

Property Value

Vector3

Rotation

Gets or sets the rotation.

public virtual Quaternion Rotation { get; set; }

Property Value

Quaternion

Scale

Gets or sets the scale.

public virtual Vector3 Scale { get; set; }

Property Value

Vector3

Transform

Gets the UnityEngine.Transform.

public Transform Transform { get; }

Property Value

Transform

Methods

AddComponent(Type, string)

Adds a component to the IEntity.

public EActor AddComponent(Type type, string name = "")

Parameters

type Type

The Type of the EActor to be added.

name string

The name of the component.

Returns

EActor

The added EActor component.

AddComponent<T>(string)

Adds a component to the IEntity.

public T AddComponent<T>(string name = "") where T : EActor

Parameters

name string

The name of the component.

Returns

T

The added EActor component.

Type Parameters

T

The T EActor to be added.

AddComponent<T>(Type, string)

Adds a component from the IEntity.

public T AddComponent<T>(Type type, string name = "") where T : EActor

Parameters

type Type

The Type of the EActor to be added.

name string

The name of the component.

Returns

T

The added EActor component.

Type Parameters

T

The T cast EActor type.

AttachTo(EActor, EActor)

Attaches a EActor to the specified EActor.

public static void AttachTo(EActor to, EActor from)

Parameters

to EActor

The actor to be modified.

from EActor

The source actor.

AttachTo(EActor, GameObject)

Attaches a EActor to the specified UnityEngine.GameObject.

public static void AttachTo(EActor comp, GameObject gameObject)

Parameters

comp EActor

EActor.

gameObject GameObject

UnityEngine.GameObject.

GetComponent(Type)

Gets a component from the IEntity.

public EActor GetComponent(Type type)

Parameters

type Type

The Type of the EActor to look for.

Returns

EActor

The EActor component.

GetComponent<T>()

Gets a component from the IEntity.

public T GetComponent<T>() where T : EActor

Returns

T

The EActor component.

Type Parameters

T

The T EActor to look for.

GetComponent<T>(Type)

Gets a component from the IEntity.

public T GetComponent<T>(Type type) where T : EActor

Parameters

type Type

The Type of the EActor to look for.

Returns

T

The EActor component.

Type Parameters

T

The cast T EActor.

HasComponent(Type, bool)

Checks if the IEntity has an active component.

public bool HasComponent(Type type, bool depthInheritance = false)

Parameters

type Type

The EActor to look for.

depthInheritance bool

A value indicating whether subclasses should be considered.

Returns

bool

true if the component was found; otherwise, false.

HasComponent<T>(bool)

Checks if the IEntity has an active component.

public bool HasComponent<T>(bool depthInheritance = false)

Parameters

depthInheritance bool

A value indicating whether subclasses should be considered.

Returns

bool

true if the component was found; otherwise, false.

Type Parameters

T

The EActor to look for.

OnBeginDestroy()

Fired before the current EObject instance is destroyed.

protected override void OnBeginDestroy()

OnBeginPlay()

Fired after the first fixed tick.

protected virtual void OnBeginPlay()

OnEndPlay()

Fired before the current EActor instance is destroyed.

protected virtual void OnEndPlay()

PostInitialize()

Fired after the EActor instance is created.

protected virtual void PostInitialize()

SubscribeEvents()

Subscribes all the events.

protected virtual void SubscribeEvents()

Tick()

Fired every tick.

protected virtual void Tick()

TryGetComponent(Type, out EActor)

Tries to get a component from the IEntity.

public bool TryGetComponent(Type type, out EActor component)

Parameters

type Type

The Type of the EActor to get.

component EActor

The found component.

Returns

bool

true if the component was found; otherwise, false.

TryGetComponent<T>(Type, out T)

Tries to get a component from the IEntity.

public bool TryGetComponent<T>(Type type, out T component) where T : EActor

Parameters

type Type

The Type of the EActor to get.

component T

The found component.

Returns

bool

true if the component was found; otherwise, false.

Type Parameters

T

The cast T EActor.

TryGetComponent<T>(out T)

Tries to get a component from the IEntity.

public bool TryGetComponent<T>(out T component) where T : EActor

Parameters

component T

The T EActor.

Returns

bool

true if the component was found; otherwise, false.

Type Parameters

T

The T EActor to look for.

UnsubscribeEvents()

Unsubscribes all the events.

protected virtual void UnsubscribeEvents()