C# Класс EnemyBase, Corsair

Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
baseHealth int
baseMoneyValue int
damageValue int
healthBarSize Vector2

Защищенные свойства (Protected)

Свойство Тип Описание
animator Animator
debuffs List
health int

Открытые методы

Метод Описание
ApplyDebuffs ( ) : void

Applies the debuffs to the EnemyBase

Damage ( int damage ) : void

Reduces the damage the enemy takes by it's armor.

DamageOverTime ( int damage, float duration, float interval, StatusEffects status ) : void

Damages the enemy over time. Updates a coroutine that flashes a color over the EnemyBase sprite.

DestroyThis ( ) : IEnumerator

Called when this objects time has come to an end. Spawns a death int with the money the user get, returns enemy to pool, and cleans up references.

DirectDamage ( int damage ) : void

Doesn't take armor into acount.

OnEnable ( ) : void

Called when object is enabled.

ReduceArmor ( int amount, float duration ) : void

Reduces the armor.

ReverseDirection ( float duration ) : void

Makes the enemy move backwards along it's path.

Slow ( float percentage, float duration ) : void

Slows the EnemyBase by a percentage.

Percentage is 0-1 not 0-100

Update ( ) : void

Called once per frame.

Защищенные методы

Метод Описание
AgentChangedNodes ( ) : void

Is called when the Agnet changes Nodes.

AgentReachedDestination ( ) : void

Is called when the Agnet reaches the destination.

InitAttributes ( ) : void

Initializes the attributes.

Приватные методы

Метод Описание
StartOrUpdateCoroutine ( StatusEffects enemyState, float duration ) : void

A helper method that updates or starts the Flash coroutine.

Описание методов

AgentChangedNodes() защищенный Метод

Is called when the Agnet changes Nodes.
protected AgentChangedNodes ( ) : void
Результат void

AgentReachedDestination() защищенный Метод

Is called when the Agnet reaches the destination.
protected AgentReachedDestination ( ) : void
Результат void

ApplyDebuffs() публичный Метод

Applies the debuffs to the EnemyBase
public ApplyDebuffs ( ) : void
Результат void

Damage() публичный Метод

Reduces the damage the enemy takes by it's armor.
public Damage ( int damage ) : void
damage int Damage inflicted before armor reduction.
Результат void

DamageOverTime() публичный Метод

Damages the enemy over time. Updates a coroutine that flashes a color over the EnemyBase sprite.
public DamageOverTime ( int damage, float duration, float interval, StatusEffects status ) : void
damage int The total damage.
duration float Duration of effect.
interval float The interval to inflict damage.
status StatusEffects The status of the enemy.
Результат void

DestroyThis() публичный Метод

Called when this objects time has come to an end. Spawns a death int with the money the user get, returns enemy to pool, and cleans up references.
public DestroyThis ( ) : IEnumerator
Результат IEnumerator

DirectDamage() публичный Метод

Doesn't take armor into acount.
public DirectDamage ( int damage ) : void
damage int Damage to inclict.
Результат void

InitAttributes() защищенный Метод

Initializes the attributes.
protected InitAttributes ( ) : void
Результат void

OnEnable() публичный Метод

Called when object is enabled.
public OnEnable ( ) : void
Результат void

ReduceArmor() публичный Метод

Reduces the armor.
public ReduceArmor ( int amount, float duration ) : void
amount int Amount to reduce.
duration float Duration of effect.
Результат void

ReverseDirection() публичный Метод

Makes the enemy move backwards along it's path.
public ReverseDirection ( float duration ) : void
duration float Duration of effect.
Результат void

Slow() публичный Метод

Slows the EnemyBase by a percentage.
Percentage is 0-1 not 0-100
public Slow ( float percentage, float duration ) : void
percentage float Percent to slow.
duration float Duration of effect.
Результат void

Update() публичный Метод

Called once per frame.
public Update ( ) : void
Результат void

Описание свойств

animator защищенное свойство

A reference to the Animator component.
protected Animator animator
Результат Animator

baseHealth публичное свойство

The max posible health of the EnemyBase.
public int baseHealth
Результат int

baseMoneyValue публичное свойство

The money gained by the player before adjusting for wave count and difficulty.
public int baseMoneyValue
Результат int

damageValue публичное свойство

The damage done to the player.
public int damageValue
Результат int

debuffs защищенное свойство

A list of Debuffs that are effecting the EnemyBase.
protected List debuffs
Результат List

health защищенное свойство

The current health of the EnemyBase.
protected int health
Результат int

healthBarSize публичное свойство

The size of the healthbar.
public Vector2 healthBarSize
Результат Vector2