private void Start() { initialPosition = transform.position; locked = false; Score = GameObject.FindGameObjectWithTag("Score"); score = Score.GetComponent <Player_score>(); }
private void Start() { timer = mainTimer; Score = GameObject.FindGameObjectWithTag("Score"); score = Score.GetComponent <Player_score>(); GameObject gameover = GameObject.Find("Gameover"); GameOver GameOver_script = gameover.GetComponent <GameOver>(); GameOver_script.callingScence = SceneManager.GetActiveScene().buildIndex; }
private void dec_btt_Click(object sender, EventArgs e) { this.Player_score -= 10; if (Player_score >= 0 && Player_score < 10) { score_lb.Text = "00" + Player_score; return; } if (Player_score >= 10 && Player_score < 100) { score_lb.Text = "0" + Player_score; return; } score_lb.Text = Player_score.ToString(); }
private void add_custom_btt_Click(object sender, EventArgs e) { try { this.Add_score = Convert.ToInt32(addScore_tb.Text); Player_score = Add_score; if (Player_score >= 0 && Player_score < 10) { score_lb.Text = "00" + Player_score; return; } if (Player_score >= 10 && Player_score < 100) { score_lb.Text = "0" + Player_score; return; } score_lb.Text = Player_score.ToString(); } catch (Exception ex) { MessageBox.Show("Không nhập đúng định dạng !!! : " + ex.Message); return; } }
// Use this for initialization void Start() { startPos = this.transform.position; Score = GameObject.FindGameObjectWithTag("Score"); score = Score.GetComponent <Player_score>(); }