コード例 #1
0
    public void spellHighlight(string spellName)
    {
        BoardHighlights.Instance.hideHighlights();
        if (selectedPiece)
        {
            selectedPiece.GetComponent <Outline>().enabled = false;
            selectedPiece = null;
        }
        if (isSpellMove)
        {
            isSpellMove = false;
        }
        else
        {
            isSpellMove    = true;
            this.spellName = spellName;
            switch (spellName)
            {
            case "Upgrade":
                allowedMoves = spells.possibleUpgrade();
                break;

            case "Stun":
                allowedMoves = spells.possibleStun();
                break;

            case "Cover":
                allowedMoves = spells.possibleCover();
                break;
            }
            BoardHighlights.Instance.highlightAllowedMoves(allowedMoves);
        }
    }
コード例 #2
0
 private void selectChessPiece(int x, int y)
 {
     allowedMoves  = chessMen[x, y].possibleMove();
     selectedPiece = chessMen[x, y];
     selectedPiece.GetComponent <Outline>().enabled = true;
     BoardHighlights.Instance.highlightAllowedMoves(allowedMoves);
 }