void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); AlignText(WinningText, Alignment.Center, 25); AlignText(ScoreText, Alignment.Center, 175); ScoreText.Text = DisplayedScore.ToString("N0"); WinningText.Draw(spriteBatch); ScoreText.Draw(spriteBatch); RestartButton.Draw(spriteBatch); NextButton.Draw(spriteBatch); Star1.Draw(spriteBatch); Star2.Draw(spriteBatch); Star3.Draw(spriteBatch); }