コード例 #1
0
        public void SelectLine(CardLine line)
        {
            var slot = transform.GetChild(lastCardIndex);

            slot.transform.GetChild(0).GetComponent <Image>().sprite = cardsOnHands[lastCardIndex].icon;

            var acceptableLines = cards[lastCardIndex].acceptableLines;

            if (!acceptableLines.HasFlag(line))
            {
                return;
            }

            Vector2 point;

            RectTransformUtility.ScreenPointToLocalPointInRectangle(blockArea, Input.mousePosition, null, out point);
            if (point.y > (blockArea.rect.y + blockArea.rect.height) || point.y < 0 || point.x < blockArea.rect.x || point.x > (blockArea.rect.x + blockArea.rect.width))
            {
                player.CastCard(lastCardIndex, line);
                LoadHands();
            }
        }