private Texture2D defaultCursor; // Store the original cursor
void Start()
{
Cursor.SetCursor(defaultCursor, Vector2.zero, CursorMode.Auto); // Store the default cursor
}
doing it like this the defaultCursor variable will be null and therefore i will not be able to use it later in the code.
i want that when i use somewhere in my code with Cursor.SetCursor with my custom texture image that i will be able to change it back to the default mouse cursor texture when need.
I saw that there is a MouseCursor and you can do for example MouseCursor.Pan or MouseCursor.Arrow but how can i change the mousecursor shape to this Pan or Arrow ? without custom texture.
private Texture2D defaultCursor; // Store the original cursor
void Start()
{
Cursor.SetCursor(defaultCursor, Vector2.zero, CursorMode.Auto); // Store the default cursor
}
doing it like this the defaultCursor variable will be null and therefore i will not be able to use it later in the code.
i want that when i use somewhere in my code with Cursor.SetCursor with my custom texture image that i will be able to change it back to the default mouse cursor texture when need.
I saw that there is a MouseCursor and you can do for example MouseCursor.Pan or MouseCursor.Arrow but how can i change the mousecursor shape to this Pan or Arrow ? without custom texture.
Share Improve this question edited Feb 18 at 2:41 Sharper asked Feb 18 at 1:50 SharperSharper 52 bronze badges New contributor Sharper is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.1 Answer
Reset to default 0To set the mouse to the default mouse texture call Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto)
, which sets the sprite to null showing the default cursor.