Well the steps to follow that comes to my mind are:
- Check what cursor is active in Windows
- Read that image as a texture in Unity
- Apply the texture to the cursor
The problem I see is this will change from OS to OS, so it will be hard for you to make it compatible with all Operative System.
I wasnt able to read the current active cursor, so my answer is uncomplete. Maybe someone will be able to complete what is missing:
//This is the part I am not sure how to complete
//String currentCursor =
//Here is where Windows store the cursors, you need to point to the one the
//user is using
String path = "C:\Windows\Cursors"+currentCursor;
//Here you load that image as a texture
Texture2D cursorTexture = new Texture2D(16, 16);
cursorTexture.LoadImage(File.ReadAllBytes(path));
public CursorMode cursorMode = CursorMode.Auto;
public Vector2 hotSpot = Vector2.zero;
//You apply the texture to the cursor in Unity
void Start()
{
Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);
}
Maybe you can find here how to do the first step using something similar to this, however I don´t know it