一、实现目标
实现鼠标持续可视化
二、实现方法
The First Step:创建一个空对象 -- 命民为CursonVisible
The Second Step:创建一个C#脚本 -- AlwaysShowMouse
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AlwaysShowMouse : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Cursor.visible = true;
//避免锁定鼠标,保持其自由移动
Cursor.lockState = CursorLockMode.None;
}
}
TheThird Step:添加脚本组件
三、结果测试
运行游戏,即可使鼠标常显示