Next: , Previous: , Up: Interaction   [Contents][Index]


9.7 Deployer

Component: Deployer

This component implements TF2-style deployment functionality. To use, supply a matching list for each object in ’Deployables’ you need one in ’Ghost Deployables’ ’Buttons’ ’Deployables Count’ and ’Deployables Max’. So for example if ’Deployables’ #3 is a turret, then ’Deployables Count’ #3 indicates how many turrets we have.

For an in-depth explanation of use, see the accompanying documentation file (found in this folder)

Field of Deployer: string forbiddenSurfaceTag

Forbidden objects should have this tag so you can’t deploy on them

Default value: "NoDeploy"

Field of Deployer: bool showGUI

Should we use a legacy Unity GUI? Not suitable for mobile devices

Default value: true

Field of Deployer: Rect guiArea

Normalized viewport rectangle indicating the screen area for the legacy GUI, values between 0 and 1

Default value: new Rect(0.01f, 0.01f, 0.88f, 0.1f)

Field of Deployer: Rect deployButton

Normalized viewport rectangle indicating the screen area for the ’Deploy’ button, values between 0 and 1

Default value: new Rect(0.89f, 0.01f, 0.2f, 0.1f)

Field of Deployer: GameObject[] deployables

Ordered list of objects that can be deployed

Field of Deployer: GameObject[] ghostDeployables

Ordered list matching the Deployables list indicating prefabs with no collider used as ’ghosts’ or ’holograms’ showing where the object will go

Field of Deployer: Texture2D[] buttons

Ordered list matching the Deployables list indicating the button textures

Field of Deployer: int[] deployablesCount

Ordered list showing the available number of each deployable currently available

Field of Deployer: int[] deployablesMax

Ordered list showing the max available for each deployable

Field of Deployer: Directions direction

Direction to render the button list

Default value: Directions.Horizontal

Field of Deployer: GameObject deployRayOrigin

An object indicating the origin of the deploy ray. In a first person game, should be in front of and slightly above the camera. Raycasts downward automatically

Field of Deployer: float deployRayRange

How far from the Deploy Ray Origin do we look down to check if we can deploy on a given surface?

Default value: 2.4f

Field of Deployer: KeyCode deployModeKey

Key for turning on/off deploy mode

Default value: KeyCode.Q

Field of Deployer: KeyCode nextItem

Key for scrolling through available deploys

Default value: KeyCode.X

Field of Deployer: KeyCode previousItem

Key for scrolling back through available deploys

Default value: KeyCode.Z

Field of Deployer: KeyCode deployItem

Key that deploys the selected item immediately

Default value: KeyCode.E

Message on Deployer: CancelDeploy ()

Stops the deployment process

Message on Deployer: SelectDeployable (int)

Changes which deployable is currently selected and initiates deployment.

Argument: An integer indicating which deployable we wish to use. Zero-indexed, so the first element is 0, and the last is the number of elements minus one.

Message on Deployer: Deploy ()

Attempts to deploy the currently selected Deployable

Field of Deployer: string forbiddenSurfaceTag

Forbidden objects should have this tag so you can’t deploy on them

Default value: "NoDeploy"

Field of Deployer: bool showGUI

Should we use a legacy Unity GUI? Not suitable for mobile devices

Default value: true

Field of Deployer: Rect guiArea

Normalized viewport rectangle indicating the screen area for the legacy GUI, values between 0 and 1

Default value: new Rect(0.01f, 0.01f, 0.88f, 0.1f)

Field of Deployer: Rect deployButton

Normalized viewport rectangle indicating the screen area for the ’Deploy’ button, values between 0 and 1

Default value: new Rect(0.89f, 0.01f, 0.2f, 0.1f)

Field of Deployer: GameObject[] deployables

Ordered list of objects that can be deployed

Field of Deployer: GameObject[] ghostDeployables

Ordered list matching the Deployables list indicating prefabs with no collider used as ’ghosts’ or ’holograms’ showing where the object will go

Field of Deployer: Texture2D[] buttons

Ordered list matching the Deployables list indicating the button textures

Field of Deployer: int[] deployablesCount

Ordered list showing the available number of each deployable currently available

Field of Deployer: int[] deployablesMax

Ordered list showing the max available for each deployable

Field of Deployer: Directions direction

Direction to render the button list

Default value: Directions.Horizontal

Field of Deployer: GameObject deployRayOrigin

An object indicating the origin of the deploy ray. In a first person game, should be in front of and slightly above the camera. Raycasts downward automatically

Field of Deployer: float deployRayRange

How far from the Deploy Ray Origin do we look down to check if we can deploy on a given surface?

Default value: 2.4f

Field of Deployer: KeyCode deployModeKey

Key for turning on/off deploy mode

Default value: KeyCode.Q

Field of Deployer: KeyCode nextItem

Key for scrolling through available deploys

Default value: KeyCode.X

Field of Deployer: KeyCode previousItem

Key for scrolling back through available deploys

Default value: KeyCode.Z

Field of Deployer: KeyCode deployItem

Key that deploys the selected item immediately

Default value: KeyCode.E

Message on Deployer: CancelDeploy ()

Stops the deployment process

Message on Deployer: SelectDeployable (int)

Changes which deployable is currently selected and initiates deployment.

Argument: An integer indicating which deployable we wish to use. Zero-indexed, so the first element is 0, and the last is the number of elements minus one.

Message on Deployer: Deploy ()

Attempts to deploy the currently selected Deployable


Next: , Previous: , Up: Interaction   [Contents][Index]