Next: Click Painter, Previous: Interaction.Output, Up: Interaction [Contents][Index]
This component implements RTS-style camera motion and object deployment. Legacy GUI is not recommended for mobile. To use, add this to your MainCamera (which must be tagged ’MainCamera’) and then set up a list of deployable objects. This works with the ’ResourceManager’ component (optionally) to allow for a resource-based experience.
There is a more in-depth manual ’MouseCommanderDoc.rtf’ found in the MultiGame/Scripts/Interaction/RTS folder in your project, explaining the system in more detail than can fit in this text box.
LayerMask
deployMaskWhat objects can we deploy on, by collision mask?
List<string>
selectableTagsWhat objects can be selected using banding boxes?
Default value: new List<string>()
bool
boxSelectIf enabled, we will draw a box on screen when the user clicks and drags the mouse, and select anything inside that box tagged with one of the ’SelectableTags’
Default value: true
Rect
selectableAreaWhat area of the screen is available for selection? Clicks outside of this area are ignored. This is represented as a ’Normalized Viewport Rectangle’, where each value indicates a percentage of screen space represented as a decimal value between 0 and 1.
Default value: new Rect(0,0,1,1)
bool
useGUIShould we use Unity’s legacy GUI for this? Not suitable for mobile devices
Default value: true
Layouts
layoutWhich direction should the buttons be drawn in?
Default value: Layouts.Horizontal
Rect
guiAreaNormalized viewport rectangle indicating where we should draw the buttons. Numbers indicate a percentage of screen space from 0 to 1
Default value: new Rect(0.01f, 0.88f, .98f, .11f)
bool
controlPositionShould we control the position of this object using a rigidbody? Useful for command cameras
Default value: true
float
deadZoneStick dead zone, for control smoothing
Default value: 0.25f
float
forceMovement force to apply
Default value: 1000.0f
float
ySpeedHow fast does the scroll wheel move us?
Default value: 20.0f
KeyCode
continuationModifierWhat key, if any, can the player hold down to keep deploying more of the same thing?
Default value: KeyCode.LeftShift
string
radiusSearchTagTag of objects we can’t deploy close to
Default value: ""
Deployable[]
deploysWhat objects can the player buy?
MessageManager.ManagedMessage
insufficientResourceMessageSent when we can’t afford something
MessageManager.ManagedMessage
itemSelectedMessageSent when we can afford a selection
MessageManager.ManagedMessage
itemTooCloseMessageSent when we failed to deploy something due to radius restriction
bool
debugSend useful information to the console
Default value: false
Activate deployment for a ’Deployable’
Argument: Index indicating which of the ’Deploys’ you wish to allow the player to place ’
Deploys the designated object immediately at the mouse position
Argument: The index of the Deployable you wish to deploy.
Allows banding box selection by clicking and dragging.
Disables banding box selection across the entire screen.
Opens/closes the build GUI
Opens the build GUI
Closes the build GUI
LayerMask
deployMaskWhat objects can we deploy on, by collision mask?
List<string>
selectableTagsWhat objects can be selected using banding boxes?
Default value: new List<string>()
bool
boxSelectIf enabled, we will draw a box on screen when the user clicks and drags the mouse, and select anything inside that box tagged with one of the ’SelectableTags’
Default value: true
Rect
selectableAreaWhat area of the screen is available for selection? Clicks outside of this area are ignored. This is represented as a ’Normalized Viewport Rectangle’, where each value indicates a percentage of screen space represented as a decimal value between 0 and 1.
Default value: new Rect(0,0,1,1)
bool
useGUIShould we use Unity’s legacy GUI for this? Not suitable for mobile devices
Default value: true
Layouts
layoutWhich direction should the buttons be drawn in?
Default value: Layouts.Horizontal
Rect
guiAreaNormalized viewport rectangle indicating where we should draw the buttons. Numbers indicate a percentage of screen space from 0 to 1
Default value: new Rect(0.01f, 0.88f, .98f, .11f)
bool
controlPositionShould we control the position of this object using a rigidbody? Useful for command cameras
Default value: true
float
deadZoneStick dead zone, for control smoothing
Default value: 0.25f
float
forceMovement force to apply
Default value: 1000.0f
float
ySpeedHow fast does the scroll wheel move us?
Default value: 20.0f
KeyCode
continuationModifierWhat key, if any, can the player hold down to keep deploying more of the same thing?
Default value: KeyCode.LeftShift
string
radiusSearchTagTag of objects we can’t deploy close to
Default value: ""
Deployable[]
deploysWhat objects can the player buy?
MessageManager.ManagedMessage
insufficientResourceMessageSent when we can’t afford something
MessageManager.ManagedMessage
itemSelectedMessageSent when we can afford a selection
MessageManager.ManagedMessage
itemTooCloseMessageSent when we failed to deploy something due to radius restriction
bool
debugSend useful information to the console
Default value: false
Activate deployment for a ’Deployable’
Argument: Index indicating which of the ’Deploys’ you wish to allow the player to place ’
Deploys the designated object immediately at the mouse position
Argument: The index of the Deployable you wish to deploy.
Allows banding box selection by clicking and dragging.
Disables banding box selection across the entire screen.
Opens/closes the build GUI
Opens the build GUI
Closes the build GUI
Next: Click Painter, Previous: Interaction.Output, Up: Interaction [Contents][Index]