首页 > 代码库 > 改变鼠标图标

改变鼠标图标

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CursorManager : MonoBehaviour {

public static CursorManager _instance;
public Texture2D cursor_normal;
public Texture2D cursor_npc_talk;

private Vector2 hotspot = Vector2.zero;
private CursorMode mode = CursorMode.Auto;
void Start () {
_instance = this;
}


public void SetNormal() {
Cursor.SetCursor(cursor_normal,hotspot,mode);
}
public void SetNpcTalk() {
Cursor.SetCursor(cursor_npc_talk,hotspot,mode);
}
}

改变鼠标图标