Show / Hide Table of Contents

Class EnemyCharacter

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
Object
BaseCharacter
EnemyCharacter
Implements
IAttackable
Namespace: BaseDefense.Characters
Assembly: BaseDefense.dll
Syntax
[RequireComponent(typeof(ItemDrop), typeof(Ragdoll))]
public sealed class EnemyCharacter : BaseCharacter, IAttackable

Properties

AttackDistance

Расстояние, с которого персонаж начинает атаковать

Declaration
public float AttackDistance { get; }
Property Value
Type Description
float

[0, infinity]

MaxSpeed

Максимально развиваемая персонажем скорость

Declaration
public float MaxSpeed { get; }
Property Value
Type Description
float

[0, infinity]

WalkingSpeed

Declaration
public float WalkingSpeed { get; }
Property Value
Type Description
float

Methods

AttackPlayer()

Вызывается для атаки на игрока

Declaration
public void AttackPlayer()

Constructor(PlayerCharacter)

Declaration
[Inject]
public void Constructor(PlayerCharacter player)
Parameters
Type Name Description
PlayerCharacter player

EnemyUpdate()

Заменяет обычный Update метод

Declaration
public bool EnemyUpdate()
Returns
Type Description
bool

Возвращает false, если персонаж мёртв

Remarks

Должен вызываться из другого сценария. Обычно это сценарий, который порождает персонажей данного типа

GetRandomPoint()

Вызывается для получения случайной целевой точки патруля

Declaration
public Vector3 GetRandomPoint()
Returns
Type Description
Vector3

Hit(float)

Declaration
public override void Hit(float damage)
Parameters
Type Name Description
float damage
Overrides
BaseCharacter.Hit(float)

Initialize(Transform[], Vector3, Quaternion)

Вызывается как для порождения нового врага, так и для респавна умершего

Declaration
public void Initialize(Transform[] targetPoints, Vector3 position, Quaternion rotation)
Parameters
Type Name Description
Transform[] targetPoints

Целевые точки для патруля

Vector3 position

Точка спавна врага

Quaternion rotation

Поворот, принимаемый во время спавна

OnDeath()

Declaration
protected override void OnDeath()
Overrides
BaseCharacter.OnDeath()

Patrol()

Вызывается для патруля

Declaration
public void Patrol()

Implements

IAttackable
In This Article
Back to top Generated by DocFX