// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { RedScore.GetComponent <TeamScore>().AddScore(); Debug.Log("赤スコア1追加"); } if (Input.GetKeyDown(KeyCode.Alpha2)) { GreenScore.GetComponent <TeamScore>().AddScore(); Debug.Log("緑スコア1追加"); } if (Input.GetKeyDown(KeyCode.Alpha3)) { BlueScore.GetComponent <TeamScore>().AddScore(); Debug.Log("青スコア1追加"); } if (Input.GetKeyDown(KeyCode.Alpha4)) { YellowScore.GetComponent <TeamScore>().AddScore(); Debug.Log("黄スコア1追加"); } if (Input.GetKeyDown(KeyCode.Alpha5)) { YellowScore.GetComponent <TeamScore>().SubScore(); Debug.Log("黄スコア1減少"); } if (Input.GetKeyDown(KeyCode.Alpha6)) { Yellow_SetScore = 0; YellowScore.GetComponent <TeamScore>().SetScore(Yellow_SetScore); Debug.Log("黄スコアをセット"); } }
// show scores of the snakes void DisplayScoreBoard() { // set the back color of the backboard scoreBack.BackColor = Color.Brown; // make the scoreboard controls visible scoreBack.Visible = true; scoreBackWhite.Visible = true; RedScore.Visible = true; RedScore.BringToFront(); GreenScore.Visible = true; GreenScore.BringToFront(); lblRed.Visible = true; lblRed.BringToFront(); lblGreen.Visible = true; lblGreen.BringToFront(); winBanner.Visible = true; winBanner.BringToFront(); // show the scores in the score board RedScore.Text = string.Format("{0:0.#}", (double)snakeRed.Length / (double)BodyPart.SIZE); GreenScore.Text = string.Format("{0:0.#}", (double)snake.Length / (double)BodyPart.SIZE); }
public GreenScore GetSumGreenAndScore(DateTime?begin, DateTime?end) { GreenScore gs = new GreenScore(); string strWhere = ""; try { if (begin != null && end != null) { strWhere = " createtime >=@begin and createtime <=@end "; } else if (begin == null && end != null) { strWhere = " createtime <=@end "; } else if (begin != null && end == null) { strWhere = " createtime >=@begin "; } else { strWhere = " 1=1 "; } using (var db = ReadOnlySanNongDunConn()) { string sql = string.Format(@"select ISNULL(SUM(GreenCount),0) from AccountInfo where{0}", strWhere); string sqlScore = string.Format(@"select ISNULL(SUM(Score),0) from AccountInfo where{0}", strWhere); gs.GreenCount = db.DbConnecttion.ExecuteScalar <decimal>(sql, Engineer.ggg, new { begin = begin, end = end }); gs.Score = db.DbConnecttion.ExecuteScalar <decimal>(sqlScore, Engineer.ggg, new { begin = begin, end = end }); } } catch (Exception ex) { LogHelper.WriteLog(typeof(UserDal), "GetSumMoney", Engineer.ggg, null, ex); } return(gs); }