C# Class CBuilding, astrochimps

Class with building definitions
Inheritance: CBaseEntity
Afficher le fichier Open project: arcoelho01/astrochimps Class Usage Examples

Méthodes publiques

Свойство 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

Méthodes publiques

Méthode 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

Méthode 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 méthode

When the script is initialized
public Awake ( ) : void
Résultat void

BuildIt() public méthode

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

Desabotage() public méthode

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

ExtractResource() public méthode

Extract resource from the resource site
public ExtractResource ( ) : void
Résultat void

FixByEngineer() public méthode

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
Résultat void

GetControlRoomSpot() public méthode

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

GetExitSpot() public méthode

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

GetExitSpotPosition() public méthode

Returns the position of the exit spot of this building
public GetExitSpotPosition ( ) : Vector3
Résultat Vector3

GetTheMonkeyOut() public méthode

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
Résultat void

IsIdle() public méthode

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. ///
Résultat void

PutAMonkeyInside() public méthode

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
Résultat void

PutAMonkeyInsideRocket() public méthode

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

ReceivePrisoner() public méthode

Receive a delivered prisoner
public ReceivePrisoner ( CMonkey monkeyPrisoner ) : void
monkeyPrisoner CMonkey
Résultat void

Sabotage() public méthode

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

Select() public méthode

public Select ( ) : Transform
Résultat Transform

TemporarySabotage() public méthode

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
Résultat void

TheresAMonkeyInside() public méthode

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

Update() public méthode

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

Work() public méthode

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

Property Details

buildingType public_oe property

public eBuildingType buildingType
Résultat eBuildingType

conectado public_oe property

public bool conectado
Résultat bool

construido public_oe property

public bool construido
Résultat bool

idleStatus public_oe property

public bool idleStatus
Résultat bool

level public_oe property

public int level
Résultat int

monkeyInside public_oe property

public Transform monkeyInside
Résultat Transform

myTimer public_oe property

public float myTimer
Résultat float

resourceSite public_oe property

public CBaseEntity resourceSite
Résultat CBaseEntity

sabotado public_oe property

public bool sabotado
Résultat bool

sabotagedParticleSystem public_oe property

public Transform sabotagedParticleSystem
Résultat Transform

sfxLoadMonkey public_oe property

public AudioClip sfxLoadMonkey
Résultat AudioClip

sfxSabotados public_oe property

public AudioClip sfxSabotados
Résultat AudioClip

sfxSelected public_oe property

public AudioClip sfxSelected
Résultat AudioClip

showInfoObject public_oe property

public Transform showInfoObject
Résultat Transform

tipo public_oe property

public TipoEstrutura tipo
Résultat TipoEstrutura

vida public_oe property

public int vida
Résultat int

workTime public_oe property

public float workTime
Résultat float