A* Pathfinding Project  4.3.2
The A* Pathfinding Project for Unity 3D
RTSUnit Class Reference

Public Types

enum  Type {
  Infantry, Heavy, Worker, Harvester,
  HarvesterDropoff = 100, HarvesterDropoffQueue, ResourceCrystal = 200
}
 

Public Member Functions

void ApplyDamage (float damage)
 
void Die ()
 
void OnMakeActiveUnit (bool active)
 
void SetDestination (Vector3 destination, MovementMode mode)
 

Public Attributes

GameObject deathEffect
 
float detectionRange
 
float health
 
bool locked
 
float maxHealth
 
System.Action< bool > onMakeActiveUnit
 
RTSUnit reservedBy
 
GameObject selectionIndicator
 
int storedCrystals
 
int team
 
Type type
 

Protected Member Functions

override void Awake ()
 
virtual void OnUpdate (List< RTSUnit >[] unitsByOwner)
 
- Protected Member Functions inherited from VersionedMonoBehaviour
virtual int OnUpgradeSerializedData (int version, bool unityThread)
 Handle serialization backwards compatibility. More...
 
virtual void Reset ()
 Handle serialization backwards compatibility. More...
 

Protected Attributes

Vector3 position
 Position at the start of the current frame. More...
 

Properties

RTSPlayer owner [get]
 
float radius [get]
 
RTSHarvestableResource resource [get]
 
bool selected [get, set]
 
bool selectionIndicatorEnabled [get, set]
 
- Properties inherited from VersionedMonoBehaviour
int Util.IEntityIndex. EntityIndex [get, set]
 Internal entity index used by #BurstBatchHelper. More...
 
- Properties inherited from IEntityIndex
int EntityIndex [get, set]
 

Private Member Functions

IEnumerator DieCoroutine ()
 
void OnDisable ()
 
void OnEnable ()
 

Static Private Member Functions

static void OnUpdate (RTSUnit[] units, int count)
 

Private Attributes

IAstarAI ai
 
RTSUnit attackTarget
 
Vector3 lastDestination
 
float lastSeenAttackTarget = float.NegativeInfinity
 
MovementMode movementMode
 
bool mSelected
 
bool reachedDestination
 
RVOController rvo
 
new Transform transform
 
RTSWeapon weapon
 

Static Private Attributes

static System.Action< RTSUnit[], int > OnUpdateDelegate
 

Member Enumeration Documentation

◆ Type

enum Type
strong
Enumerator
Infantry 
Heavy 
Worker 
Harvester 
HarvesterDropoff 
HarvesterDropoffQueue 
ResourceCrystal 

Member Function Documentation

◆ ApplyDamage()

void ApplyDamage ( float  damage)

◆ Awake()

override void Awake ( )
protectedvirtual

Reimplemented from VersionedMonoBehaviour.

◆ Die()

void Die ( )

◆ DieCoroutine()

IEnumerator DieCoroutine ( )
private

◆ OnDisable()

void OnDisable ( )
private

◆ OnEnable()

void OnEnable ( )
private

◆ OnMakeActiveUnit()

void OnMakeActiveUnit ( bool  active)

◆ OnUpdate() [1/2]

static void OnUpdate ( RTSUnit []  units,
int  count 
)
staticprivate

◆ OnUpdate() [2/2]

virtual void OnUpdate ( List< RTSUnit > []  unitsByOwner)
protectedvirtual

◆ SetDestination()

void SetDestination ( Vector3  destination,
MovementMode  mode 
)

Member Data Documentation

◆ ai

IAstarAI ai
private

◆ attackTarget

RTSUnit attackTarget
private

◆ deathEffect

GameObject deathEffect

◆ detectionRange

float detectionRange

◆ health

float health

◆ lastDestination

Vector3 lastDestination
private

◆ lastSeenAttackTarget

float lastSeenAttackTarget = float.NegativeInfinity
private

◆ locked

bool locked

◆ maxHealth

float maxHealth

◆ movementMode

MovementMode movementMode
private

◆ mSelected

bool mSelected
private

◆ onMakeActiveUnit

System.Action<bool> onMakeActiveUnit

◆ OnUpdateDelegate

System.Action<RTSUnit[], int> OnUpdateDelegate
staticprivate

◆ position

Vector3 position
protected

Position at the start of the current frame.

◆ reachedDestination

bool reachedDestination
private

◆ reservedBy

RTSUnit reservedBy

◆ rvo

RVOController rvo
private

◆ selectionIndicator

GameObject selectionIndicator

◆ storedCrystals

int storedCrystals

◆ team

int team

◆ transform

new Transform transform
private

◆ type

Type type

◆ weapon

RTSWeapon weapon
private

Property Documentation

◆ owner

RTSPlayer owner
get

◆ radius

float radius
get

◆ resource

RTSHarvestableResource resource
get

◆ selected

bool selected
getset

◆ selectionIndicatorEnabled

bool selectionIndicatorEnabled
getset

The documentation for this class was generated from the following file: