Skip to content

Class: Entity ​

csharp
[LogicUpdatePriority(-400)]
[RequireComponent(typeof(EntityAI))]
[RequireComponent(typeof(EntityAnimation))]
[RequireComponent(typeof(EntityControl))]
[RequireComponent(typeof(EntityStatus))]
[RequireComponent(typeof(EntityVisual))]
[RequireComponent(typeof(EntityAbility))]
[RequireComponent(typeof(EntitySound))]
public class Entity : Actor, ILogicUpdate, ICleanup, ICustomDestroyRoutine

Fields ​

NameDeclarationDescription
ClientEntityEvent_OnIsSleepingChangedpublic SafeAction<bool> ClientEntityEvent_OnIsSleepingChanged
ClientEntityEvent_OnStatusEffectAddedpublic SafeAction<EventInfoStatusEffect> ClientEntityEvent_OnStatusEffectAdded
ClientEntityEvent_OnStatusEffectRemovedpublic SafeAction<EventInfoStatusEffect> ClientEntityEvent_OnStatusEffectRemoved
EntityEvent_OnAttackDodgedpublic SafeAction<EventInfoAttackMissed> EntityEvent_OnAttackDodged
EntityEvent_OnAttackEffectTriggeredpublic SafeAction<EventInfoAttackEffect> EntityEvent_OnAttackEffectTriggered
EntityEvent_OnAttackFiredpublic SafeAction<EventInfoAttackFired> EntityEvent_OnAttackFired
EntityEvent_OnAttackFiredBeforePreparepublic SafeAction<EventInfoAttackFired> EntityEvent_OnAttackFiredBeforePrepare
EntityEvent_OnAttackHitpublic SafeAction<EventInfoAttackHit> EntityEvent_OnAttackHit
EntityEvent_OnAttackMissedpublic SafeAction<EventInfoAttackMissed> EntityEvent_OnAttackMissed
EntityEvent_OnAttackTakenpublic SafeAction<EventInfoAttackHit> EntityEvent_OnAttackTaken
EntityEvent_OnCastCompletepublic SafeAction<EventInfoCast> EntityEvent_OnCastComplete
EntityEvent_OnCastCompleteBeforePreparepublic SafeAction<EventInfoCast> EntityEvent_OnCastCompleteBeforePrepare
EntityEvent_OnDamageNegatedByImmunitypublic SafeAction<EventInfoDamageNegatedByImmunity> EntityEvent_OnDamageNegatedByImmunity
EntityEvent_OnDamageNegatedByShieldpublic SafeAction<EventInfoDamageNegatedByShield> EntityEvent_OnDamageNegatedByShield
EntityEvent_OnDeathpublic SafeAction<EventInfoKill> EntityEvent_OnDeath
EntityEvent_OnGetManaSpentpublic SafeAction<EventInfoSpentMana> EntityEvent_OnGetManaSpent
EntityEvent_OnTakeDamagepublic SafeAction<EventInfoDamage> EntityEvent_OnTakeDamage
EntityEvent_OnTakeHealpublic SafeAction<EventInfoHeal> EntityEvent_OnTakeHeal
EntityEvent_OnTakeManaHealpublic SafeAction<EventInfoHeal> EntityEvent_OnTakeManaHeal
EntityEvent_OnTakeShieldpublic SafeAction<EventInfoShield> EntityEvent_OnTakeShield
takenDamageProcessorpublic DataProcessorGroup<DamageData, Actor, Entity> takenDamageProcessorProcessor for all received damages (Except pure damage). This is only valid on server.
takenHealProcessorpublic DataProcessorGroup<HealData, Actor, Entity> takenHealProcessorProcessor for received heals. This is only valid on server.
takenManaHealProcessorpublic DataProcessorGroup<HealData, Actor, Entity> takenManaHealProcessorProcessor for received mana heals. This is only valid on server.
takenShieldProcessorpublic DataProcessorGroup<HealData, Actor, Entity> takenShieldProcessorProcessor for received shields. This is only valid on server.

Properties ​

NameDeclarationDescription
Abilitypublic EntityAbility Ability { get; }
agentPositionpublic Vector3 agentPosition { get; }
AIpublic EntityAI AI { get; }
Animationpublic EntityAnimation Animation { get; }
Controlpublic EntityControl Control { get; }
currentHealthpublic float currentHealth { get; }
currentManapublic float currentMana { get; }
defaultOwnerprotected virtual DewPlayer defaultOwner { get; }
isAlivepublic bool isAlive { get; }
isDeadpublic bool isDead { get; }
isSleepingpublic bool isSleeping { get; }
lastSectionpublic RoomSection lastSection { get; }Section that this entity resided in. Even though an entity leaves a section, this variable will not be cleared.Available on server. Can be null.
levelpublic int level { get; }
maxHealthpublic float maxHealth { get; }
maxManapublic float maxMana { get; }
normalizedHealthpublic float normalizedHealth { get; }
normalizedManapublic float normalizedMana { get; }
owner`[SaveVar(SaveVarFlags.Default)]
public DewPlayer owner { get; set; }`
sectionpublic RoomSection section { get; }Section that this entity resides in. Available on server.Can be null.
Soundpublic EntitySound Sound { get; }
Statuspublic EntityStatus Status { get; }
Visualpublic EntityVisual Visual { get; }

Methods ​

ActiveLogicUpdate(float) ​

csharp
protected override void ActiveLogicUpdate(float dt)

Parameters:

NameTypeDescription
dtfloat

AIUpdate(ref EntityAIContext) ​

AI update will not fire if entity is channeling an ability.

csharp
protected virtual void AIUpdate(ref EntityAIContext context)

Parameters:

NameTypeDescription
contextEntityAIContext

Awake() ​

csharp
protected override void Awake()

CanAggroTo(Entity) ​

csharp
public virtual bool CanAggroTo(Entity target)

Parameters:

NameTypeDescription
targetEntity

Returns: bool

CheckEnemyOrNeutral(Entity) ​

csharp
public bool CheckEnemyOrNeutral(Entity target)

Parameters:

NameTypeDescription
targetEntity

Returns: bool

GetActorReadableName() ​

csharp
public override string GetActorReadableName()

Returns: string

GetNetworkAuthorityConnection() ​

csharp
protected override NetworkConnectionToClient GetNetworkAuthorityConnection()

Returns: Mirror.NetworkConnectionToClient

GetRelation(Entity) ​

csharp
public EntityRelation GetRelation(Entity other)

Parameters:

NameTypeDescription
otherEntity

Returns: EntityRelation

GetStaggerSettings() ​

csharp
protected virtual Entity.StaggerSettings GetStaggerSettings()

Returns: Entity.StaggerSettings

GetTeamRelation(DewPlayer) ​

csharp
public TeamRelation GetTeamRelation(DewPlayer other)

Parameters:

NameTypeDescription
otherDewPlayer

Returns: TeamRelation

Kill() ​

Kill this entity. Note this can be prevented by death interrupts.

csharp
public void Kill()

KillNoInterrupt() ​

Kill this entity ignoring any death interrupts.

csharp
public void KillNoInterrupt()

LoadEntityModelLocal() ​

csharp
public virtual void LoadEntityModelLocal()

OnDeath(EventInfoKill) ​

Called everywhere when this entity dies.

csharp
protected virtual void OnDeath(EventInfoKill info)

Parameters:

NameTypeDescription
infoEventInfoKill

OnDestroyActor() ​

csharp
protected override void OnDestroyActor()

OnDrawGizmos() ​

csharp
protected virtual void OnDrawGizmos()

OnModelLoaded() ​

csharp
public virtual void OnModelLoaded()

OnPrepare() ​

csharp
protected override void OnPrepare()

OnStartServer() ​

csharp
public override void OnStartServer()

OnStopServer() ​

csharp
public override void OnStopServer()

ProcessReceivedDamage(ref DamageData, Actor) ​

Process the given damage with this entity's received damage preprocessors.

csharp
public void ProcessReceivedDamage(ref DamageData data, Actor actor)

Parameters:

NameTypeDescription
dataDamageData
actorActor

ProcessReceivedHeal(ref HealData, Actor) ​

Process the given heal with this entity's received heal preprocessors.

csharp
public void ProcessReceivedHeal(ref HealData data, Actor actor)

Parameters:

NameTypeDescription
dataHealData
actorActor

ProcessReceivedManaHeal(ref HealData, Actor) ​

Process the given mana heal with this entity's received mana heal preprocessors.

csharp
public void ProcessReceivedManaHeal(ref HealData data, Actor actor)

Parameters:

NameTypeDescription
dataHealData
actorActor

ProcessReceivedShield(ref HealData, Actor) ​

csharp
public void ProcessReceivedShield(ref HealData data, Actor actor)

Parameters:

NameTypeDescription
dataHealData
actorActor

ShouldBeSavedWithRoom() ​

csharp
public override bool ShouldBeSavedWithRoom()

Returns: bool

Sleep() ​

Make this entity sleep.

csharp
public void Sleep()

Stagger(Vector3?) ​

csharp
public void Stagger(Vector3? dir)

Parameters:

NameTypeDescription
dirUnityEngine.Vector3?

WakeUp() ​

Wake this entity up.

csharp
public void WakeUp()

Maintained by the Shape of Dreams Modding Community