Example #1
0
    void Update()
    {
        if (!TryGetTouchPosition(out Vector2 touchPosition))
        {
            return;
        }

        Touch touch = Input.GetTouch(0);

        touchPosition = touch.position;

        if (touch.phase == TouchPhase.Began)
        {
            Ray        ray = Camera.current.ScreenPointToRay(touch.position);
            RaycastHit hitObject;

            if (Physics.Raycast(ray, out hitObject))
            {
                currentPrefab.SetActive(false);
                travelling.CityCheckIn();
            }
        }
    }