C# Класс MainScript, astrochimps

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

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

Свойство Тип Описание
HUD int
MonkeyAstronaut Transform
MonkeyCientist Transform
MonkeyEngineer Transform
MonkeySaboteur Transform
Script MainScript
alliedLayer int
bnIsTheGamePaused bool
bnOnCutscene bool
bottomMenu GUIBottomMenu
cbCommandCenter CBuilding
cbResearchLab CBuilding
enemyLayer int
groundLayer int
isMinimapEnabled bool
lBoardedMonkeys List
lcRocketParts List
minimapGroundLayer int
minimapLayer int
mouseInputScript MouseWorldPosition
neutralLayer int
player CPlayer
playerObject Transform
prefabCaptureRay Transform
prefabDefeatByDeath Transform
prefabExtractor Transform
prefabFazenda Transform
prefabForceField Transform
prefabLaboratorio Transform
prefabUnderConstructionBox Transform
prefabVictorySequence Transform
questManager QuestManager
tLaunchingPlatform Transform

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

Метод Описание
ChangeDroneTeamAndUpdateList ( Transform droneObject, int droneLayer ) : void

Updates the drone's list when one of them change teams

CheckIfAllMonkeysAreBoarded ( ) : void

Check if we have all the monkeys boarded in the rocket. If so, the game was won!

CheckIfAllMonkeysAreConvicts ( ) : void

Check if we all our monkeys are not under prison. If so, we lost the game. Usually, this function is called when a drone delivers a monkey to a prison

CheckIfAreEnoughResourcesToBuild ( Transform objectToBuild ) : bool

Just check if we have enough resources to build this unit/structure

CheckIfTargetColliderIsInRange ( Vector3 callerPosition, Transform tTarget, int targetLayer, float fRadius ) : bool

Check for enemies (collider, actually) inside a radius

CheckIfTargetIsInRange ( Transform tAttacker, Transform tTarget, float fAttackRange ) : bool

Check if a target is in the range of this unit, projecting it's position in the 2D floor plane (only uses x and z coordinates)

CheckIfWeHaveOxygen ( ) : void

Check if we have enough oxygen to keep the monkeys alive

DeployUnderConstructionBox ( Transform builtOver, Transform prefabToBuild, Vector3 position, float buildTime ) : void

Create an instance of an 'Under Construction Box'

DeployUnderConstructionBox ( Vector3 position, float buildTime ) : void

Overloaded method: only deploys the construction box, wait the time and then destroy it. Doesn't instantiate the new building

GetCurrentUnitsInScene ( ) : void

Get all units in the scene, filters them and add them to the corresponding list

GetListOfAllAlliedBuildings ( ) : List
GetListOfAllMonkeys ( ) : List

Returns the list of all monkeys currently in the game

GetListOfAllNeutralResources ( ) : List
GetListOfAllRocketParts ( ) : List

Returns the list of all rocket parts transforms found in the scene

GetListOfAllRocketPartsComponents ( ) : List

Returns the list of all rocket parts CRocketPart components for the parts found in the scene

ReceiveNewEvent ( Transform trSender, QuestManager eEvent ) : void

Receive an event

getExtractRate ( ) : float
getFabricRate ( ) : float
getTaxaConsumoOxigenio ( ) : float
setDroneVisaoAumentada ( ) : void
setDroneVisaoNormal ( ) : void
setExtractRate ( float rate ) : void
setFabricRate ( float rate ) : void
setTaxaConsumoOxigenio ( float rate ) : void

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

Метод Описание
Awake ( ) : void
CheckInputKeys ( ) : void

Check for user input

DeployConstructionBox ( Vector3 position, float timeToBuild ) : IEnumerator

Create a version of Freddy's construction box

DoCheatingStuff ( ) : void

Do some cheats, for development purposes only

GameOverStartDeathByAsphyxiationSequence ( ) : void

Call the scenes when the player has no oxygen left, so the monkeys die asphyxiated

GameOverStartJailedSequence ( ) : void

What happens when the game is lost For now this happens when all player's monkeys are in jail

GameOverStartVictorySequence ( ) : void
GetCurrentDronesInScene ( ) : void

Get all drones in the scene

GetCurrentRocketPartsInScene ( ) : void

Get all the rocket parts currently in the game

GetMonkeysObjects ( ) : void

Get all monkeys in the scene, sort them by class and add their transforms to the variables declared up in this script. With this, we get shortcuts to them

Start ( ) : void
Update ( ) : void

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

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

Updates the drone's list when one of them change teams
public ChangeDroneTeamAndUpdateList ( Transform droneObject, int droneLayer ) : void
droneObject Transform
droneLayer int
Результат void

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

Check if we have all the monkeys boarded in the rocket. If so, the game was won!
public CheckIfAllMonkeysAreBoarded ( ) : void
Результат void

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

Check if we all our monkeys are not under prison. If so, we lost the game. Usually, this function is called when a drone delivers a monkey to a prison
public CheckIfAllMonkeysAreConvicts ( ) : void
Результат void

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

Just check if we have enough resources to build this unit/structure
public CheckIfAreEnoughResourcesToBuild ( Transform objectToBuild ) : bool
objectToBuild Transform
Результат bool

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

Check for enemies (collider, actually) inside a radius
public CheckIfTargetColliderIsInRange ( Vector3 callerPosition, Transform tTarget, int targetLayer, float fRadius ) : bool
callerPosition Vector3 The position to be the sphere center. Usually is the center of the caller's /// collider
tTarget Transform Target's transform, so we can filter the colliders inside the radius and know for /// sure if we touched the target
targetLayer int Target's layer, used for filtering colliders
fRadius float Radius of the sphere where we will check for other objects presence. Usually the /// caller's attack radius
Результат bool

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

Check if a target is in the range of this unit, projecting it's position in the 2D floor plane (only uses x and z coordinates)
public CheckIfTargetIsInRange ( Transform tAttacker, Transform tTarget, float fAttackRange ) : bool
tAttacker Transform Transform of the attacker
tTarget Transform Transform of the target
fAttackRange float A float with the range of the attack
Результат bool

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

Check if we have enough oxygen to keep the monkeys alive
public CheckIfWeHaveOxygen ( ) : void
Результат void

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

Create an instance of an 'Under Construction Box'
public DeployUnderConstructionBox ( Transform builtOver, Transform prefabToBuild, Vector3 position, float buildTime ) : void
builtOver Transform Transform of the object where this Box is built. With this, we can pass a /// Resource back to a built extractor, for instance. We can call it as null
prefabToBuild Transform Prefab to the building which will be built we te timer is over.
position Vector3 A Vector3 with the position to create the box and instantiate the new building, /// if any
buildTime float Time to build the building. When it's over, it will instantiate a new building, /// show the complete animation and will destroy itself
Результат void

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

Overloaded method: only deploys the construction box, wait the time and then destroy it. Doesn't instantiate the new building
public DeployUnderConstructionBox ( Vector3 position, float buildTime ) : void
position Vector3 A Vector3 with the position to create the box
buildTime float Time to build the building. When it's over, will show the complete animation /// and will destroy itself
Результат void

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

Get all units in the scene, filters them and add them to the corresponding list
public GetCurrentUnitsInScene ( ) : void
Результат void

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

public GetListOfAllAlliedBuildings ( ) : List
Результат List

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

Returns the list of all monkeys currently in the game
public GetListOfAllMonkeys ( ) : List
Результат List

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

public GetListOfAllNeutralResources ( ) : List
Результат List

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

Returns the list of all rocket parts transforms found in the scene
public GetListOfAllRocketParts ( ) : List
Результат List

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

Returns the list of all rocket parts CRocketPart components for the parts found in the scene
public GetListOfAllRocketPartsComponents ( ) : List
Результат List

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

Receive an event
public ReceiveNewEvent ( Transform trSender, QuestManager eEvent ) : void
trSender Transform Transform of the sender of this event
eEvent QuestManager EQuestEvents enum with the event
Результат void

getExtractRate() публичный статический Метод

public static getExtractRate ( ) : float
Результат float

getFabricRate() публичный статический Метод

public static getFabricRate ( ) : float
Результат float

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

public getTaxaConsumoOxigenio ( ) : float
Результат float

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

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

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

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

setExtractRate() публичный статический Метод

public static setExtractRate ( float rate ) : void
rate float
Результат void

setFabricRate() публичный статический Метод

public static setFabricRate ( float rate ) : void
rate float
Результат void

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

public setTaxaConsumoOxigenio ( float rate ) : void
rate float
Результат void

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

HUD публичное статическое свойство

public static int HUD
Результат int

MonkeyAstronaut публичное статическое свойство

public static Transform MonkeyAstronaut
Результат Transform

MonkeyCientist публичное статическое свойство

public static Transform MonkeyCientist
Результат Transform

MonkeyEngineer публичное статическое свойство

public static Transform MonkeyEngineer
Результат Transform

MonkeySaboteur публичное статическое свойство

public static Transform MonkeySaboteur
Результат Transform

Script публичное статическое свойство

public static MainScript Script
Результат MainScript

alliedLayer публичное статическое свойство

public static int alliedLayer
Результат int

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

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

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

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

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

public GUIBottomMenu bottomMenu
Результат GUIBottomMenu

cbCommandCenter публичное статическое свойство

public static CBuilding cbCommandCenter
Результат CBuilding

cbResearchLab публичное статическое свойство

public static CBuilding cbResearchLab
Результат CBuilding

enemyLayer публичное статическое свойство

public static int enemyLayer
Результат int

groundLayer публичное статическое свойство

public static int groundLayer
Результат int

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

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

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

public List lBoardedMonkeys
Результат List

lcRocketParts публичное статическое свойство

public static List lcRocketParts
Результат List

minimapGroundLayer публичное статическое свойство

public static int minimapGroundLayer
Результат int

minimapLayer публичное статическое свойство

public static int minimapLayer
Результат int

mouseInputScript публичное статическое свойство

public static MouseWorldPosition mouseInputScript
Результат MouseWorldPosition

neutralLayer публичное статическое свойство

public static int neutralLayer
Результат int

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

public CPlayer player
Результат CPlayer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

public QuestManager questManager
Результат QuestManager

tLaunchingPlatform публичное статическое свойство

public static Transform tLaunchingPlatform
Результат Transform