C# Class CDrone, astrochimps

Class with drones definitions
Inheritance: CBaseEntity
显示文件 Open project: arcoelho01/astrochimps Class Usage Examples

Public Properties

Property Type Description
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

Public Methods

Method Description
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

Private Methods

Method Description
DestroyDrone ( ) : IEnumerator

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

Method Details

Attack() public method

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. ///
return void

Attacked() public method

What to do when this drone is attacked?
public Attacked ( ) : void
return void

Awake() public method

When the script is initialized
public Awake ( ) : void
return void

Deselect() public method

public Deselect ( ) : void
return void

DestroyThisDrone() public method

Actually destroy the drone game object
public DestroyThisDrone ( ) : void
return void

EnterNewState() public method

Changes the FSM to a new state
public EnterNewState ( FSMState, eNewState ) : void
eNewState FSMState, The new state
return void

ExecuteCurrentState() public method

Executes the FSM current state
public ExecuteCurrentState ( ) : void
return void

FadeOutDrone() public method

Uses iTween to fade out the destroyed drone
public FadeOutDrone ( ) : void
return void

GetColliderInfo() public method

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
return void

GetCurrentState() public method

Returns the FSM current state
public GetCurrentState ( ) : FSMState,
return FSMState,

LeaveCurrentState() public method

Leaves the current state. Used whenever the FSM enters a new state
public LeaveCurrentState ( ) : void
return void

OnAStarReachedEndOfPath() public method

This method is called when the Astar reaches the end of the path
public OnAStarReachedEndOfPath ( Transform eventRaiser, bool isMoving ) : void
eventRaiser Transform
isMoving bool
return void

OnDestroy() public method

What to do when this object is destroyed
public OnDestroy ( ) : void
return void

OnDisable() public method

What to do when this object is disabled
public OnDisable ( ) : void
return void

OnEnable() public method

What to do when this object is enabled
public OnEnable ( ) : void
return void

Patrolling() public method

public Patrolling ( ) : void
return void

Recycled() public method

What to do when the drone is being recycled
public Recycled ( ) : void
return void

Reprogrammed() public method

This drone has been reprogrammed, so it will change it's team
public Reprogrammed ( ) : void
return void

Select() public method

Selected is override to play a sound
public Select ( ) : Transform
return Transform

Update() public method

public Update ( ) : void
return void

Waiting() public method

public Waiting ( ) : void
return void

WalkTo() public method

public WalkTo ( Vector3 walkTo ) : void
walkTo Vector3
return void

isStunned() public method

Helper function to tell if a drone is in the STATE_STUNNED or no. Useful for monkeys attacking this drone
public isStunned ( ) : bool
return bool

Property Details

AIScript public_oe property

public AstarAIFollow, AIScript
return AstarAIFollow,

attackRange public_oe property

public float attackRange
return float

droneType public_oe property

public eDroneType droneType
return eDroneType

enemyPatrolScript public_oe property

public EnemyPatrol, enemyPatrolScript
return EnemyPatrol,

hunterAIScript public_oe property

public DroneHunter, hunterAIScript
return DroneHunter,

patrolDroneScript public_oe property

public DronePatrol, patrolDroneScript
return DronePatrol,

patrolScript public_oe property

public Patrol, patrolScript
return Patrol,

prefabSparks public_oe property

public Transform prefabSparks
return Transform

saboteurScript public_oe property

public Saboteur, saboteurScript
return Saboteur,

sfxAttacked public_oe property

public AudioClip,UnityEngine sfxAttacked
return UnityEngine.AudioClip

sfxSelected public_oe property

public AudioClip,UnityEngine sfxSelected
return UnityEngine.AudioClip

stunnedParticleSystem public_oe property

public Transform stunnedParticleSystem
return Transform

transTarget public_oe property

public Transform transTarget
return Transform

typeTarget public_oe property

public CBaseEntity.eObjType typeTarget
return CBaseEntity.eObjType