C# Класс CBuilding, astrochimps

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

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

Свойство Тип Описание
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

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

Метод Описание
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

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

Метод Описание
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.

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

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

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

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

Create an instance of the selected building, place it and activate it
public BuildIt ( ) : void
Результат void

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

"Desabotage" (is this a real word?) this building, removing the visual aid to the player
public Desabotage ( ) : void
Результат void

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

Extract resource from the resource site
public ExtractResource ( ) : void
Результат void

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

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
Результат void

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

Find the object "ControlSpot", which designates where the monkey should be when inside the building
public GetControlRoomSpot ( ) : void
Результат void

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

Find the coordinates for the object 'ExitSpot', which designates where an unit should be when exiting the building
public GetExitSpot ( ) : void
Результат void

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

Returns the position of the exit spot of this building
public GetExitSpotPosition ( ) : Vector3
Результат Vector3

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

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
Результат void

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

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. ///
Результат void

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

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
Результат void

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

Put one of the monkey inside the rocket
public PutAMonkeyInsideRocket ( Transform tMonkey, CMonkey, eMonkeyClass ) : void
tMonkey Transform
eMonkeyClass CMonkey,
Результат void

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

Receive a delivered prisoner
public ReceivePrisoner ( CMonkey monkeyPrisoner ) : void
monkeyPrisoner CMonkey
Результат void

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

Sabotage this building, adding a visual aid to the player
public Sabotage ( ) : void
Результат void

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

public Select ( ) : Transform
Результат Transform

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

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
Результат void

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

Check if there's a monkey inside this building
public TheresAMonkeyInside ( ) : Transform
Результат Transform

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

In this update, we do whatever the building is supposed to do
public Update ( ) : void
Результат void

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

Do whatever this building is suppose to do, according to his type
public Work ( ) : void
Результат void

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

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

public eBuildingType buildingType
Результат eBuildingType

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

public bool conectado
Результат bool

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

public bool construido
Результат bool

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

public bool idleStatus
Результат bool

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

public int level
Результат int

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

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

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

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

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

public CBaseEntity resourceSite
Результат CBaseEntity

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

public bool sabotado
Результат bool

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

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

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

public AudioClip sfxLoadMonkey
Результат AudioClip

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

public AudioClip sfxSabotados
Результат AudioClip

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

public AudioClip sfxSelected
Результат AudioClip

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

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

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

public TipoEstrutura tipo
Результат TipoEstrutura

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

public int vida
Результат int

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

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