示例#1
0
    private void Update()
    {
        if (!Input.GetMouseButtonDown(0))
        {
            return;
        }

        var ray = _camera.ScreenPointToRay(Input.mousePosition);

        Debug.DrawRay(ray.origin, ray.direction);
        if (!Physics.Raycast(ray, out var hit, Mathf.Infinity))
        {
            return;
        }
        if (!hit.collider.CompareTag("Plane"))
        {
            return;
        }
        var plane = hit.collider.GetComponent <Plane>();

        _planeManager.FocusPlane(plane);
    }