今天小伙伴问我如何自己写一段代码检测 单击 双击 和 拖放.于是就写了这段代码O(∩_∩)O~ 代码如下: using UnityEngine; using System.Collections; public class Test2 : MonoBehaviour { public float oneTime; //检测双击的有效时间 private int downCount; //判断是单击还是双击 private bool currentCheck; //当前正在检测 private b
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A: B: using System; using System.Runtime.CompilerServices; using UnityEngine.Scripting; namespace UnityEngine { /// <summary> /// <para>Behaviours are Components that can be enabled or disabl
public class Main : MonoBehaviour { public Texture2D cursorTexture;//图片 public CursorMode cursorMode = CursorMode.Auto; public Vector2 hotSpot = Vector2.zero;//以左上角为目标的偏移量 void Start() { //设置光标 Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); }