C# Class CBuilding, astrochimps

Class with building definitions
Inheritance: CBaseEntity
Mostra file Open project: arcoelho01/astrochimps Class Usage Examples

Public Properties

Property Type Description
buildingType eBuildingType
conectado bool
construido bool
idleStatus bool
level int
monkeyInside Transform
myTimer float
resourceSite CBaseEntity
sabotado bool
sabotagedParticleSystem Transform
sfxLoadMonkey AudioClip
sfxSabotados AudioClip
sfxSelected AudioClip
showInfoObject Transform
tipo TipoEstrutura
vida int
workTime float

Public Methods

Method Description
Awake ( ) : void

When the script is initialized

BuildIt ( ) : void

Create an instance of the selected building, place it and activate it

Desabotage ( ) : void

"Desabotage" (is this a real word?) this building, removing the visual aid to the player

ExtractResource ( ) : void

Extract resource from the resource site

FixByEngineer ( ) : void

Fixing the building by an engineer. For now, it only changes the state from "sabotaged" to "not sabotaged" TODO: add some cost in resources (metal?) when this is done. And check if we can afford it before fixing

GetControlRoomSpot ( ) : void

Find the object "ControlSpot", which designates where the monkey should be when inside the building

GetExitSpot ( ) : void

Find the coordinates for the object 'ExitSpot', which designates where an unit should be when exiting the building

GetExitSpotPosition ( ) : Vector3

Returns the position of the exit spot of this building

GetTheMonkeyOut ( ) : void

Get the monkey out of the building, so it will be free to roam the terrain. The building is no more affected by his bonus

IsIdle ( bool bnIdleStatus ) : void

Change the status of this building.

PutAMonkeyInside ( Transform monkeyIn ) : void

Put a monkey inside this building. Building controller directly by monkey are more efficient somehow

PutAMonkeyInsideRocket ( Transform tMonkey, CMonkey, eMonkeyClass ) : void

Put one of the monkey inside the rocket

ReceivePrisoner ( CMonkey monkeyPrisoner ) : void

Receive a delivered prisoner

Sabotage ( ) : void

Sabotage this building, adding a visual aid to the player

Select ( ) : Transform
TemporarySabotage ( float fTimer ) : void

Call a coroutine to use a timed sabotage. When the timer if over, the building will be restored to it's functional status. Useful for the player sabotaging enemy building

TheresAMonkeyInside ( ) : Transform

Check if there's a monkey inside this building

Update ( ) : void

In this update, we do whatever the building is supposed to do

Work ( ) : void

Do whatever this building is suppose to do, according to his type

Private Methods

Method Description
ShowInfoForExtractedResource ( string stResource, float amountExtracted ) : IEnumerator

Show a text tag with the resource extracted and it's amount. Floats up the screen and then vanishes. Useful to show the player what the extractor is doing

TimedSabotageCoroutine ( float fTimer ) : IEnumerator

Coroutine that implements the timed sabotage. First, sabotage the building. Then, after the timer expired, restore it to the functional status.

Method Details

Awake() public method

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

BuildIt() public method

Create an instance of the selected building, place it and activate it
public BuildIt ( ) : void
return void

Desabotage() public method

"Desabotage" (is this a real word?) this building, removing the visual aid to the player
public Desabotage ( ) : void
return void

ExtractResource() public method

Extract resource from the resource site
public ExtractResource ( ) : void
return void

FixByEngineer() public method

Fixing the building by an engineer. For now, it only changes the state from "sabotaged" to "not sabotaged" TODO: add some cost in resources (metal?) when this is done. And check if we can afford it before fixing
public FixByEngineer ( ) : void
return void

GetControlRoomSpot() public method

Find the object "ControlSpot", which designates where the monkey should be when inside the building
public GetControlRoomSpot ( ) : void
return void

GetExitSpot() public method

Find the coordinates for the object 'ExitSpot', which designates where an unit should be when exiting the building
public GetExitSpot ( ) : void
return void

GetExitSpotPosition() public method

Returns the position of the exit spot of this building
public GetExitSpotPosition ( ) : Vector3
return Vector3

GetTheMonkeyOut() public method

Get the monkey out of the building, so it will be free to roam the terrain. The building is no more affected by his bonus
public GetTheMonkeyOut ( ) : void
return void

IsIdle() public method

Change the status of this building.
public IsIdle ( bool bnIdleStatus ) : void
bnIdleStatus bool A boolean. True indicates that the building is temporaly idle, so it not /// produces anything. False the building is functional. ///
return void

PutAMonkeyInside() public method

Put a monkey inside this building. Building controller directly by monkey are more efficient somehow
public PutAMonkeyInside ( Transform monkeyIn ) : void
monkeyIn Transform Transform of the monkey that will be inside the building
return void

PutAMonkeyInsideRocket() public method

Put one of the monkey inside the rocket
public PutAMonkeyInsideRocket ( Transform tMonkey, CMonkey, eMonkeyClass ) : void
tMonkey Transform
eMonkeyClass CMonkey,
return void

ReceivePrisoner() public method

Receive a delivered prisoner
public ReceivePrisoner ( CMonkey monkeyPrisoner ) : void
monkeyPrisoner CMonkey
return void

Sabotage() public method

Sabotage this building, adding a visual aid to the player
public Sabotage ( ) : void
return void

Select() public method

public Select ( ) : Transform
return Transform

TemporarySabotage() public method

Call a coroutine to use a timed sabotage. When the timer if over, the building will be restored to it's functional status. Useful for the player sabotaging enemy building
public TemporarySabotage ( float fTimer ) : void
fTimer float Time that the building will stay sabotaged
return void

TheresAMonkeyInside() public method

Check if there's a monkey inside this building
public TheresAMonkeyInside ( ) : Transform
return Transform

Update() public method

In this update, we do whatever the building is supposed to do
public Update ( ) : void
return void

Work() public method

Do whatever this building is suppose to do, according to his type
public Work ( ) : void
return void

Property Details

buildingType public_oe property

public eBuildingType buildingType
return eBuildingType

conectado public_oe property

public bool conectado
return bool

construido public_oe property

public bool construido
return bool

idleStatus public_oe property

public bool idleStatus
return bool

level public_oe property

public int level
return int

monkeyInside public_oe property

public Transform monkeyInside
return Transform

myTimer public_oe property

public float myTimer
return float

resourceSite public_oe property

public CBaseEntity resourceSite
return CBaseEntity

sabotado public_oe property

public bool sabotado
return bool

sabotagedParticleSystem public_oe property

public Transform sabotagedParticleSystem
return Transform

sfxLoadMonkey public_oe property

public AudioClip sfxLoadMonkey
return AudioClip

sfxSabotados public_oe property

public AudioClip sfxSabotados
return AudioClip

sfxSelected public_oe property

public AudioClip sfxSelected
return AudioClip

showInfoObject public_oe property

public Transform showInfoObject
return Transform

tipo public_oe property

public TipoEstrutura tipo
return TipoEstrutura

vida public_oe property

public int vida
return int

workTime public_oe property

public float workTime
return float