如何在C#中使用鼠标?
我得到一个错误,说鼠标不存在,虽然我从Unity 4教程中得到了这个,在那里它似乎工作得很好如何在C#中使用鼠标?,c#,unity3d,C#,Unity3d,我得到一个错误,说鼠标不存在,虽然我从Unity 4教程中得到了这个,在那里它似乎工作得很好 提前谢谢。为什么不直接传递int而不投射鼠标按钮呢 为什么不直接传递一个int而不用鼠标按钮呢 你错过了课程: using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Update() { if (Input.GetMouseButtonDow
提前谢谢。为什么不直接传递int而不投射鼠标按钮呢
为什么不直接传递一个int而不用鼠标按钮呢
你错过了课程:
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Update() {
if (Input.GetMouseButtonDown(0))
Debug.Log("Pressed left click.");
if (Input.GetMouseButtonDown(1))
Debug.Log("Pressed right click.");
if (Input.GetMouseButtonDown(2))
Debug.Log("Pressed middle click.");
}
}
你错过了课程:
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Update() {
if (Input.GetMouseButtonDown(0))
Debug.Log("Pressed left click.");
if (Input.GetMouseButtonDown(1))
Debug.Log("Pressed right click.");
if (Input.GetMouseButtonDown(2))
Debug.Log("Pressed middle click.");
}
}
“小老鼠”??不存在“老鼠”吗??不存在。
public class MouseUtils {
public enum Button : int { Left = 0, Right = 1, Middle = 2, None = 3 };
}