private void Awake()
        {
            if (!PlayerPrefs.HasKey("HighScore"))
            {
                PlayerPrefs.SetInt("HighScore", 0);
            }

            ScoreText.text     = FarsiTextUtil.FixText("0");
            HighScoreText.text = FarsiTextUtil.FixText(
                PlayerPrefs.GetInt("HighScore").ToString()
                );
        }
示例#2
0
        private void GameOver()
        {
            FiroozehGameService.Instance.SaveGame(
                "2048Save"
                , "2048SaveGame"
                , new Save {
                Score = ScoreTracker.Score, HighScore = PlayerPrefs.GetInt("HighScore")
            }
                , c => {}, e => {});


            GameOverScoreText.text = FarsiTextUtil.FixText(ScoreTracker.Score.ToString());
            GameOverPanel.Show();
            State = GameState.GameOver;
        }
        private void Start()
        {
            Text = GetComponent <Text>();
            switch (Type)
            {
            case TextType.Name:
                Text.text = FarsiTextUtil.FixText("بازی ۲۰۴۸");
                break;

            case TextType.des:
                Text.text = FarsiTextUtil.FixText("قدرت گرفته از");
                break;

            case TextType.Score:
                Text.text = FarsiTextUtil.FixText("امتیاز");
                break;

            case TextType.HighScore:
                Text.text = FarsiTextUtil.FixText("بیشترین امتیاز");
                break;

            case TextType.NewGame:
                Text.text = FarsiTextUtil.FixText("بازی جدید");
                break;

            case TextType.GameOver:
                Text.text = FarsiTextUtil.FixText("باختی! امتیاز شما : ");
                break;

            case TextType.Won:
                Text.text = FarsiTextUtil.FixText("بردی!آفرین");
                break;

            case TextType.Restart:
                Text.text = FarsiTextUtil.FixText("دوباره");
                break;

            case TextType.Continue:
                Text.text = FarsiTextUtil.FixText("ادامه");
                break;

            default:
                break;
            }
        }
 private void ApplyStyleFromHolder(int index)
 {
     _tileText.text   = FarsiTextUtil.FixText(GameManager.Instance.TileStyleHolder.TileStyles[index].Number.ToString());
     _tileText.color  = GameManager.Instance.TileStyleHolder.TileStyles[index].TextColor;
     _tileImage.color = GameManager.Instance.TileStyleHolder.TileStyles[index].TileColor;
 }