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
aspect
EntityAspectThe aspect to copy from.
strict
boolIf 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
entity
EntityThe entity to associate with this aspect.
strict
boolIf 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
value
floatThe 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
rooted
boolIf true, the entity will not be knocked back or grabbed, simulating a rooted state.
Is(Entity)
public static bool Is(Entity entity)
Parameters
entity
Entity
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
aggroCircleRadius
floatThe radius of the aggro circle.
aggroConeRadius
float?The radius of the aggro cone. If null, defaults to the aggro circle radius.
alertCircleRadius
float?The radius of the alert circle. If null, defaults to the aggro circle radius.
alertConeRadius
float?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
buffModificationTypes
BuffModificationTypesThe types of modifications to apply.
overwrite
boolIf 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
entity
Entity
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
value
floatThe health value to set.
SetMaxHealth(float)
Sets the maximum health of the entity's health component.
public void SetMaxHealth(float value)
Parameters
value
floatThe maximum health value to set.
SetMaxRecoveryHealth(float)
Sets the maximum recovery health of the entity's health component.
public void SetMaxRecoveryHealth(float value)
Parameters
value
floatThe maximum recovery health value to set.