Class UnitAspect
public class UnitAspect : EntityAspect, IAspect<Entity>, IAspect
- Inheritance
-
BaseAspect<Entity>UnitAspect
- Implements
-
IAspect<Entity>
- Derived
- Inherited Members
- Extension Methods
Constructors
UnitAspect(EntityAspect, bool)
Initializes a new instance of the EntityAspect class with another aspect.
public UnitAspect(EntityAspect aspect, bool strict = true)
Parameters
aspectEntityAspectThe aspect to copy from.
strictboolIf true, the aspect will throw an exception if the entity is null.
Exceptions
- ArgumentNullException
Thrown when the entity of the aspect is null.
UnitAspect(Entity, bool)
Initializes a new instance of the EntityAspect class with the specified entity.
public UnitAspect(Entity entity, bool strict = true)
Parameters
entityEntityThe entity to associate with this aspect.
strictboolIf true, the aspect will throw an exception if the entity is null.
Exceptions
- ArgumentNullException
Thrown when the entity is null.
Properties
CurrentHealth
public virtual float? CurrentHealth { get; }
Property Value
Health
public virtual Health? Health { get; }
Property Value
- Health?
IsDead
public virtual bool IsDead { get; }
Property Value
Level
public virtual float? Level { get; }
Property Value
MaxHealth
public virtual float? MaxHealth { get; }
Property Value
PrefabEnum
public Unit PrefabEnum { get; }
Property Value
Queries
public static UnitQueries Queries { get; }
Property Value
UnitLevel
public virtual UnitLevel? UnitLevel { get; }
Property Value
- UnitLevel?
UnitRespawnTime
public virtual UnitRespawnTime? UnitRespawnTime { get; }
Property Value
- UnitRespawnTime?
UnitStats
public virtual UnitStats? UnitStats { get; }
Property Value
- UnitStats?
Methods
AddHealth(float)
Adds health to the entity's health component, clamping it to the maximum health if set.
public void AddHealth(float value)
Parameters
valuefloatThe amount of health to add (supports negative values).
DisableAggro()
Disables aggro for the entity, preventing others from attacking it.
public void DisableAggro()
GiveKnockbackResistance(bool)
Gives the entity knockback resistance, preventing it from being knocked back or grabbed.
public void GiveKnockbackResistance(bool rooted)
Parameters
rootedboolIf true, the entity will not be knocked back or grabbed, simulating a rooted state.
Is(Entity)
public static bool Is(Entity entity)
Parameters
entityEntity
Returns
ModifyAggroRadius(float, float?, float?, float?)
Modifies the aggro radius of the entity.
public void ModifyAggroRadius(float aggroCircleRadius, float? aggroConeRadius = null, float? alertCircleRadius = null, float? alertConeRadius = null)
Parameters
aggroCircleRadiusfloatThe radius of the aggro circle.
aggroConeRadiusfloat?The radius of the aggro cone. If null, defaults to the aggro circle radius.
alertCircleRadiusfloat?The radius of the alert circle. If null, defaults to the aggro circle radius.
alertConeRadiusfloat?The radius of the alert cone. If null, defaults to the aggro cone radius or aggro circle radius.
ModifyBuff(BuffModificationTypes, bool)
Modifies a buff entity with specified modification types.
public void ModifyBuff(BuffModificationTypes buffModificationTypes, bool overwrite = false)
Parameters
buffModificationTypesBuffModificationTypesThe types of modifications to apply.
overwriteboolIf true, clears existing modifications before applying new ones.
Qualifies(Entity)
Checks if the entity qualifies for this aspect.
public override bool Qualifies(Entity entity)
Parameters
entityEntity
Returns
- bool
Returns true if the entity qualifies, otherwise false.
SetHealth(float)
Sets the health of the entity's health component, clamping it to the maximum health if set.
public void SetHealth(float value)
Parameters
valuefloatThe health value to set.
SetMaxHealth(float)
Sets the maximum health of the entity's health component.
public void SetMaxHealth(float value)
Parameters
valuefloatThe maximum health value to set.
SetMaxRecoveryHealth(float)
Sets the maximum recovery health of the entity's health component.
public void SetMaxRecoveryHealth(float value)
Parameters
valuefloatThe maximum recovery health value to set.