예제 #1
0
    public void Hit(Vector3 pos)
    {
        // Debug.Log("2");
        Ray ray = Camera.main.ScreenPointToRay(pos);

        RaycastHit[] hits;
        hits = Physics.RaycastAll(ray);
        for (int i = 0; i < hits.Length; i++)
        {
            RaycastHit hit = hits[i];
            if (hit.collider.gameObject.GetComponent <Disk>() != null)
            {
                score_recorder.RecordScore(hit.collider.gameObject);
                hit.collider.gameObject.transform.position = new Vector3(0, -15, 0);
            }
        }
    }