Skip to content

Hooks.Cursor

Mariusz edited this page Feb 26, 2020 · 5 revisions

Hooks' Cursor nested class contains all utility methods based around the mouse/pointer/cursor.

Public Methods

Vector2 GetMouseUIPosition(Camera, bool)

Returns the Mouse's World position, pixel position on screen if Boolean value is false, otherwise it returns by using camera's ScreenToViewportPoint.

Vector3 GetMouseWorldPosition(Camera)

Gets the world position of the mouse.

Quaternion RotateTowardsMouse(Camera, Vector2,[float = 0f])

Returns a rotation from position based on the camera, which would rotate towards the mouse.

Public Fields/Properties/Constants

Vector2 MousePosInPercent (get-only)

Returns the anchored position of the mouse in Vector2.