private void Awake() { if (instance == null) { instance = this; } photonView = GetComponent <PhotonView>(); }
private void DrawHud(SpriteBatch spriteBatch) { // Score ScoreHud.Draw(spriteBatch, Screen.Player.Score); // Time LevelHud.Draw(spriteBatch, Screen.Player.Level); // Time TimeHud.Draw(spriteBatch, Convert.ToInt32(TotalTime)); }
void Awake() { float sc_h = Screen.height / GameControl.BASE_HEIGHT; inst = this; float height = Screen.height; float max_width = 256 * sc_h; hud_score = new Rect(0 * sc_h, height - 64 * sc_h, max_width, 32 * sc_h); hud_numbers = new Rect[SCORE_NUMS]; num_val = new int[SCORE_NUMS]; for (int i = 0; i < SCORE_NUMS; i++) { hud_numbers[i] = new Rect((i * 44) * sc_h, height - 32 * sc_h, 44 * sc_h, 32 * sc_h); } SetValue(0); }