Touch Ray로 3d오브젝트 선택하기


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            Physics.Raycast(ray, out hit);
 
            if (hit.collider != null)
            {
                CurrentTouch = hit.transform.gameObject;
                EventActivate();
            }
        }
    }
cs


댓글

Designed by JB FACTORY