You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
601 B
C#
30 lines
601 B
C#
1 month ago
|
using UnityEngine;
|
||
|
|
||
|
public class CursorManager : MonoBehaviour
|
||
|
{
|
||
|
public static CursorManager Instance;
|
||
|
|
||
|
[Header("Cursor Textures")]
|
||
|
public Texture2D defaultCursor;
|
||
|
public Texture2D linkCursor;
|
||
|
|
||
|
[Header("Cursor Hotspot")]
|
||
|
public Vector2 hotspot = Vector2.zero;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
Instance = this;
|
||
|
SetDefaultCursor();
|
||
|
}
|
||
|
|
||
|
public void SetDefaultCursor()
|
||
|
{
|
||
|
Cursor.SetCursor(defaultCursor, hotspot, CursorMode.Auto);
|
||
|
}
|
||
|
|
||
|
public void SetLinkCursor()
|
||
|
{
|
||
|
Cursor.SetCursor(linkCursor, hotspot, CursorMode.Auto);
|
||
|
}
|
||
|
}
|