C# Класс CDrone, astrochimps

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

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

Свойство Тип Описание
AIScript AstarAIFollow,
attackRange float
droneType eDroneType
enemyPatrolScript EnemyPatrol,
hunterAIScript DroneHunter,
patrolDroneScript DronePatrol,
patrolScript Patrol,
prefabSparks Transform
saboteurScript Saboteur,
sfxAttacked UnityEngine.AudioClip
sfxSelected UnityEngine.AudioClip
stunnedParticleSystem Transform
transTarget Transform
typeTarget CBaseEntity.eObjType

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

Метод Описание
Attack ( Transform transTarget ) : void

Attack the specified transTarget. Considering all the tests we need to do it's probably best just to send the gameobject. Or not gotta discuss

Attacked ( ) : void

What to do when this drone is attacked?

Awake ( ) : void

When the script is initialized

Deselect ( ) : void
DestroyThisDrone ( ) : void

Actually destroy the drone game object

EnterNewState ( FSMState, eNewState ) : void

Changes the FSM to a new state

ExecuteCurrentState ( ) : void

Executes the FSM current state

FadeOutDrone ( ) : void

Uses iTween to fade out the destroyed drone

GetColliderInfo ( ) : void

Get info about the collider in this object. This is needed so we know what are the boundaries of the object. With this, we can calculate the distance of the object from others, knowing if we can attack them, for instance

GetCurrentState ( ) : FSMState,

Returns the FSM current state

LeaveCurrentState ( ) : void

Leaves the current state. Used whenever the FSM enters a new state

OnAStarReachedEndOfPath ( Transform eventRaiser, bool isMoving ) : void

This method is called when the Astar reaches the end of the path

OnDestroy ( ) : void

What to do when this object is destroyed

OnDisable ( ) : void

What to do when this object is disabled

OnEnable ( ) : void

What to do when this object is enabled

Patrolling ( ) : void
Recycled ( ) : void

What to do when the drone is being recycled

Reprogrammed ( ) : void

This drone has been reprogrammed, so it will change it's team

Select ( ) : Transform

Selected is override to play a sound

Update ( ) : void
Waiting ( ) : void
WalkTo ( Vector3 walkTo ) : void
isStunned ( ) : bool

Helper function to tell if a drone is in the STATE_STUNNED or no. Useful for monkeys attacking this drone

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

Метод Описание
DestroyDrone ( ) : IEnumerator

Plays a final animation and, when it's over, destroy the drone object

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

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

Attack the specified transTarget. Considering all the tests we need to do it's probably best just to send the gameobject. Or not gotta discuss
public Attack ( Transform transTarget ) : void
transTarget Transform /// Transform transTarget. ///
Результат void

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

What to do when this drone is attacked?
public Attacked ( ) : void
Результат void

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

When the script is initialized
public Awake ( ) : void
Результат void

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

public Deselect ( ) : void
Результат void

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

Actually destroy the drone game object
public DestroyThisDrone ( ) : void
Результат void

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

Changes the FSM to a new state
public EnterNewState ( FSMState, eNewState ) : void
eNewState FSMState, The new state
Результат void

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

Executes the FSM current state
public ExecuteCurrentState ( ) : void
Результат void

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

Uses iTween to fade out the destroyed drone
public FadeOutDrone ( ) : void
Результат void

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

Get info about the collider in this object. This is needed so we know what are the boundaries of the object. With this, we can calculate the distance of the object from others, knowing if we can attack them, for instance
public GetColliderInfo ( ) : void
Результат void

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

Returns the FSM current state
public GetCurrentState ( ) : FSMState,
Результат FSMState,

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

Leaves the current state. Used whenever the FSM enters a new state
public LeaveCurrentState ( ) : void
Результат void

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

This method is called when the Astar reaches the end of the path
public OnAStarReachedEndOfPath ( Transform eventRaiser, bool isMoving ) : void
eventRaiser Transform
isMoving bool
Результат void

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

What to do when this object is destroyed
public OnDestroy ( ) : void
Результат void

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

What to do when this object is disabled
public OnDisable ( ) : void
Результат void

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

What to do when this object is enabled
public OnEnable ( ) : void
Результат void

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

public Patrolling ( ) : void
Результат void

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

What to do when the drone is being recycled
public Recycled ( ) : void
Результат void

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

This drone has been reprogrammed, so it will change it's team
public Reprogrammed ( ) : void
Результат void

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

Selected is override to play a sound
public Select ( ) : Transform
Результат Transform

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

public Update ( ) : void
Результат void

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

public Waiting ( ) : void
Результат void

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

public WalkTo ( Vector3 walkTo ) : void
walkTo Vector3
Результат void

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

Helper function to tell if a drone is in the STATE_STUNNED or no. Useful for monkeys attacking this drone
public isStunned ( ) : bool
Результат bool

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

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

public AstarAIFollow, AIScript
Результат AstarAIFollow,

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

public float attackRange
Результат float

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

public eDroneType droneType
Результат eDroneType

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

public EnemyPatrol, enemyPatrolScript
Результат EnemyPatrol,

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

public DroneHunter, hunterAIScript
Результат DroneHunter,

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

public DronePatrol, patrolDroneScript
Результат DronePatrol,

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

public Patrol, patrolScript
Результат Patrol,

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

public Transform prefabSparks
Результат Transform

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

public Saboteur, saboteurScript
Результат Saboteur,

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

public AudioClip,UnityEngine sfxAttacked
Результат UnityEngine.AudioClip

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

public AudioClip,UnityEngine sfxSelected
Результат UnityEngine.AudioClip

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

public Transform stunnedParticleSystem
Результат Transform

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

public Transform transTarget
Результат Transform

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

public CBaseEntity.eObjType typeTarget
Результат CBaseEntity.eObjType