コード例 #1
0
    public void updateWhiteBlackChessmanData() //捉取場地上所有黑白棋子的資料
    {
        allChess   = new List <Chessman>();
        whiteChess = new List <Chessman>();
        blackChess = new List <Chessman>();

        foreach (var item in GameObject.FindGameObjectsWithTag("chess"))
        {
            Chessman chessmanItem = item.GetComponent <Chessman>();
            if (!chessmanItem)
            {
                continue;
            }
            allChess.Add(chessmanItem);
            if (chessmanItem.group == groupEnum.white)
            {
                whiteChess.Add(chessmanItem);
            }
            else if (chessmanItem.group == groupEnum.black)
            {
                blackChess.Add(chessmanItem);
                dragon dragonItem = item.GetComponent <dragon>();
                if (!dragonItem)
                {
                    continue;
                }
                dragon = dragonItem;
                countdownScript.instance.updateCountDownImage();
            }
            else
            {
                pillar pillarItem = item.GetComponent <pillar>();
                if (!pillarItem)
                {
                    continue;
                }
                pillarChessV2.Add(getChessmanV2(pillarItem));
            }
        }
    }
コード例 #2
0
        public static void gencave()
        {
            Random    rand = new Random();
            caveplace curr;

            for (int i = 0; i < 5; i++)
            {
                if (cavelist.Count > 1)
                {
                    curr = cavelist[Combat.Dice.roll(1, cavelist.Count - 1)];
                }
                else if (cavelist.Count == 1)
                {
                    curr = cavelist[0];
                }
                else
                {
                    break;
                }
                cavemap[i] = curr;
                cavelist.Remove(curr);
            }
            cavemap[4] = new dragon();
        }