hi i have a custom mouse for my unity game but i want it to when hovering over something to change to a different mouse cursor here is my code for the mouse cursor so far:
using UnityEngine;
using System.Collections;
public class CursorIcon : MonoBehaviour
{
public static int guiDepth = 0;
public Texture2D cursorImage;
private int cursorWidth = 32;
private int cursorHeight = 32;
void Awake() {
DontDestroyOnLoad(this);
}
void Start()
{
Screen.showCursor = false;
}
void OnGUI()
{
GUI.depth = guiDepth;
GUI.DrawTexture(new Rect(Input.mousePosition.x, Screen.height - Input.mousePosition.y, cursorWidth, cursorHeight), cursorImage);
}
void Update() {
}
}
any help will be appreciated thank you.