public class ExampleClass : MonoBehaviour {
void Update() {
// 0, 1, 2에 따라 마우스 [왼쪽버튼], [오른쪽버튼], [휠버튼]
if (Input.GetMouseButton (0))
Debug.Log("마우스 버튼을 누르는 동안");
if (Input.GetMouseButtonDown (1))
Debug.Log("마우스 버튼을 누른 순간");
if (Input.GetMousebuttonUp (2))
Debug.Log("마우스 버튼을 눌렀다 때는 순간.");
// Input.mousePositio 마우스 클릭한 좌표값 얻을수 있음
}
}
'c# 강의 > 유니티' 카테고리의 다른 글
20200512 - 델리게이트 / 대리자 (0) | 2020.05.12 |
---|---|
▶ 유니티/싱글톤 - DataManager (0) | 2020.05.12 |
20200511 - 현재까지 패키지 구성 (0) | 2020.05.11 |
20200511 - Scene (0) | 2020.05.11 |
20200511 - FindWithTag (자주 쓰이는 예제 필요) (0) | 2020.05.11 |