Skip to content

Instantly share code, notes, and snippets.

@bartwttewaall
Created July 22, 2019 08:34
Show Gist options
  • Save bartwttewaall/88c50b68cd5a9eca5f9696be29095a8a to your computer and use it in GitHub Desktop.
Save bartwttewaall/88c50b68cd5a9eca5f9696be29095a8a to your computer and use it in GitHub Desktop.
Set or unset a cursor with a pivot at the center (Crosshair texture is 64x64 px)
if (player.canUseWeapons && current) {
Cursor.SetCursor (Resources.Load<Texture2D> ("Crosshair"), new Vector2 (32, 32), CursorMode.Auto);
} else {
Cursor.SetCursor (null, Vector2.zero, CursorMode.Auto);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment