provides access to the position of the players pointer position using the IMouseInput interface
usually this is done by the CameraController, this behaviour can be used instead when the camera is static
https://citybuilder.softleitner.com/manual
|
Ray | GetRay (bool applyOffset=false) |
| creates a ray under the players mouse that points in the cameras direction
can be used to check whats currently under the player pointer
|
|
Vector3 | GetMousePosition (bool applyOffset=false) |
| calculates absolute world position on the map that the pointer is currently over
|
|
Vector2 | GetMouseScreenPosition (bool applyOffset=false) |
| calculates the current position of the players pointer in screen coordinates
|
|
Vector2Int | GetMouseGridPosition (bool applyOffset=false) |
| calculates the point on the map that the pointer is currently over
|
|
|
Collider | MouseCollider |
|
Vector2 | TouchOffset = Vector3.zero |
|
|
virtual void | Awake () |
|
virtual void | Start () |
|
◆ GetMouseGridPosition()
Vector2Int CityBuilderCore.CameraMouseInput.GetMouseGridPosition |
( |
bool | applyOffset = false | ) |
|
calculates the point on the map that the pointer is currently over
- Parameters
-
applyOffset | whether the touch offset should be applied |
- Returns
- a grid point on the map
Implements CityBuilderCore.IMouseInput.
◆ GetMousePosition()
Vector3 CityBuilderCore.CameraMouseInput.GetMousePosition |
( |
bool | applyOffset = false | ) |
|
|
inline |
calculates absolute world position on the map that the pointer is currently over
- Parameters
-
applyOffset | whether the touch offset should be applied |
- Returns
- a position on the map
Implements CityBuilderCore.IMouseInput.
◆ GetMouseScreenPosition()
Vector2 CityBuilderCore.CameraMouseInput.GetMouseScreenPosition |
( |
bool | applyOffset = false | ) |
|
|
inline |
calculates the current position of the players pointer in screen coordinates
- Parameters
-
applyOffset | whether the touch offset should be applied |
- Returns
- screen space position of the pointer
Implements CityBuilderCore.IMouseInput.
◆ GetRay()
Ray CityBuilderCore.CameraMouseInput.GetRay |
( |
bool | applyOffset = false | ) |
|
creates a ray under the players mouse that points in the cameras direction
can be used to check whats currently under the player pointer
- Parameters
-
applyOffset | whether the touch offset should be applied |
- Returns
- a ray coming from the pointer
Implements CityBuilderCore.IMouseInput.