Пример #1
0
        protected void RegPillar_Click(object sender, EventArgs e)
        {
            pillar newPillar = new pillar();

            newPillar.name = PillarTextBox.Text.Trim();

            db.pillars.Add(newPillar);

            if (db.SaveChanges() > 0)
            {
                db.SaveChanges();

                Response.Redirect(Request.RawUrl);

                ScriptManager.RegisterStartupScript(
                    Page,
                    Page.GetType(),
                    "successModal", "$('#successModal').modal('show');",
                    true);
            }
        }
Пример #2
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));
            }
        }
    }