コード例 #1
0
    protected void RayCastToPosition(Vector2 position, int fingerId = -1)
    {
        RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(position), Vector2.zero);

        if (hit.collider != null)
        {
            Debug.Log("You've touched " + hit.collider.name);
            if (_inputHandler != null)
            {
                _inputHandler.HandleInputDown(hit.collider, fingerId);

                if (blockAfterSelection)
                {
                    blocked = true;
                }
            }
        }
    }