csharp/1ZouLTReX1/FP-MOG/top%20down%20shooter/Assets/Scripts/ChangeCursor.cs

ChangeCursor.cs
using UnityEngine;

public clast ChangeCursor : MonoBehaviour
{
    [SerializeField]
    Texture2D cursorTexture;
    Vector2 cursorHotspot;

    // initialize mouse with a new texture with the
    // hotspot set to the middle of the texture
    // (don't forget to set the texture in the inspector
    // in the editor)
    void Start()
    {
        cursorHotspot = new Vector2(cursorTexture.width / 2, cursorTexture.height / 2);
        Cursor.SetCursor(cursorTexture, cursorHotspot, CursorMode.Auto);
    }
}