Property | Type | Description | |
---|---|---|---|
cursorAttack | |||
cursorBuild | |||
cursorCaptureRay | |||
cursorGetInside | |||
cursorGetOut | |||
cursorNormal | |||
cursorObject | Transform | ||
cursorRecycleEnable | |||
cursorReprogramEnable | |||
cursorSabotageEnable | |||
cursorWalk | |||
cursorWalkNotOk | |||
gameBarBottom | float | ||
gameBarTop | float | ||
mouseHitPointNow | Vector3 | ||
selectedObject | Transform | ||
targetPosition | Vector3 |
Method | Description | |
---|---|---|
DeselectedObject ( ) : void |
Called from an external script, when a unit is deselected
|
|
GetSelectedObject ( ) : Transform |
Return the transform of the object currently selected, if any
|
|
IWantToSelectAPosition ( ) : void |
Executed when a script wants to receive a position when a mouse button is clicked
|
|
PositionIsAlreadySelected ( ) : bool |
Used after IWantToSelectAPosition by another script, so it will know when something is clicked and a position is selected
|
|
RemoveCursor ( ) : void |
Removes the cursor projector, destroying its object Used when we have deselected a unit
|
|
SelectObject ( Transform targetObject ) : void | ||
WhatIsThePositionSelected ( ) : Vector3 |
Used in conjuction with IWantToSelectAPosition and PositionIsAlreadySelected. If the position is already select, them polls this script to know what is this position
|
Method | Description | |
---|---|---|
Awake ( ) : void | ||
CheckLeftMouseClick ( ) : void |
Execute when the player presses the left mouse button Behaviours: select an unit, deselect-it if clicked in the terrain
|
|
CheckRightMouseClick ( ) : void |
Execute when the player presses the right mouse button Behaviours: when a movable unit is selected, select where it should walk to
|
|
DoCheatingStuff ( ) : void |
Do some cheats, for development purposes only
|
|
GetWhatIClicked ( ) : Transform |
When the player presses the mouse button, check whatever is under the mouse cursor through a raycast
|
|
MouseOver ( ) : void |
Checks the objects under the mouse cursor, showing its info in the info panel Actually, this is the main function of this script: it analyzes the context and set the mouse state and cursor accordingly
|
|
OnGUI ( ) : void |
For now, the OnGUI only draws the custom mouse cursor
|
|
ShowSelectedPositionWithAProjector ( Vector3 position, float timeToShow ) : IEnumerator |
When the player select a position to walk to, we show a cursor in the ground for visual aid
|
|
Start ( ) : void | ||
Update ( ) : void |
public SelectObject ( Transform targetObject ) : void | ||
targetObject | Transform | |
return | void |
public WhatIsThePositionSelected ( ) : Vector3 | ||
return | Vector3 |
public Texture2D,UnityEngine cursorAttack | ||
return |
public Texture2D,UnityEngine cursorBuild | ||
return |
public Texture2D,UnityEngine cursorCaptureRay | ||
return |
public Texture2D,UnityEngine cursorGetInside | ||
return |
public Texture2D,UnityEngine cursorGetOut | ||
return |
public Texture2D,UnityEngine cursorNormal | ||
return |
public Texture2D,UnityEngine cursorRecycleEnable | ||
return |
public Texture2D,UnityEngine cursorReprogramEnable | ||
return |
public Texture2D,UnityEngine cursorSabotageEnable | ||
return |
public Texture2D,UnityEngine cursorWalkNotOk | ||
return |