Class EActor
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
GameObjectThe base UnityEngine.GameObject.
Fields
DefaultFixedTickRate
The default fixed tick rate.
public const float DefaultFixedTickRate = 0.016
Field Value
Properties
CanEverTick
Gets or sets a value indicating whether the EActor can tick.
public virtual bool CanEverTick { get; set; }
Property Value
ComponentsInChildren
Gets a IReadOnlyCollection<T> of EActor containing all the components in children.
public IReadOnlyCollection<EActor> ComponentsInChildren { get; }
Property Value
ComponentsInParent
Gets a EActor[] containing all the components in parent.
protected IEnumerable<EActor> ComponentsInParent { get; }
Property Value
FixedTickRate
Gets or sets the value which determines the size of every tick.
public virtual float FixedTickRate { get; set; }
Property Value
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
Returns
AddComponent<T>(string)
Adds a component to the IEntity.
public T AddComponent<T>(string name = "") where T : EActor
Parameters
name
stringThe 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
Returns
- T
The added EActor component.
Type Parameters
T
The
T
cast EActor type.
AttachTo(EActor, EActor)
public static void AttachTo(EActor to, EActor from)
Parameters
AttachTo(EActor, GameObject)
Attaches a EActor to the specified UnityEngine.GameObject.
public static void AttachTo(EActor comp, GameObject gameObject)
Parameters
GetComponent(Type)
Gets a component from the IEntity.
public EActor GetComponent(Type type)
Parameters
Returns
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
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
TypeThe EActor to look for.
depthInheritance
boolA value indicating whether subclasses should be considered.
Returns
HasComponent<T>(bool)
Checks if the IEntity has an active component.
public bool HasComponent<T>(bool depthInheritance = false)
Parameters
depthInheritance
boolA value indicating whether subclasses should be considered.
Returns
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
Returns
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
Returns
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
TThe
T
EActor.
Returns
Type Parameters
T
The
T
EActor to look for.
UnsubscribeEvents()
Unsubscribes all the events.
protected virtual void UnsubscribeEvents()