Exemplo n.º 1
0
 public static new WordMode GetInstance()
 {
     if (instance == null)
     {
         instance = new WordMode();
     }
     return(instance);
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        GameSystem.GetInstance().OnWaveNumberChanged    += HandleOnWaveNumberChanged;
        GameSystem.GetInstance().OnScoreChanged         += HandleOnScoreChanged;
        SurvivalMode.GetInstance().OnHPChanged          += HandleOnHPChanged;
        TimeRushMode.GetInstance().OnLifeTimeChanged    += HandleOnLifeTimeChanged;
        ColorFullMode.GetInstance().OnColorChanged      += HandleOnColorChanged;
        BlackJackMode.GetInstance().OnSelectCardChanged += HandleOnSelectCardChanged;
        DualMode.GetInstance().OnTurnChanged            += HandleOnTurnChanged;
        DualMode.GetInstance().OnLeftHPChanged          += HandleOnLeftHPChanged;
        DualMode.GetInstance().OnRightHPChanged         += HandleOnRightHPChanged;
        WordMode.GetInstance().OnWordTextChanged        += HandleOnWordTextChanged;
        translationLabel.gameObject.SetActive(LocalVersion.local == LocalVersion.Local.CN_ZH);

        dualLeftSideSlider.foregroundWidget.color  = Constant.LEFT_COLOR;
        dualRightSideSlider.foregroundWidget.color = Constant.RIGHT_COLOR;
    }
Exemplo n.º 3
0
    public override void Show(bool active)
    {
        base.Show(active);
        if (active)
        {
            waveNumberLabel.text = string.Format(TextManager.GetText("wave"), GameSystem.GetInstance().DisplayWaveNumber);
            scoreLabel.text      = string.Format(TextManager.GetText("game_score"), GameSystem.GetInstance().Score);
            modeLabel.text       = TextManager.GetText(string.Format("mode_name_{0}", (int)GameSystem.GetInstance().CurrentMode));
            modeTypeLabel.text   = string.Format("({0})", TextManager.GetText(string.Format("mode_type_name_{0}", (int)GameSystem.GetInstance().CurrentModeType)));
            bestLabel.text       = string.Format(TextManager.GetText("best_score"), PlayerProfile.LoadBestRecord(GameSystem.GetInstance().CurrentMode, GameSystem.GetInstance().CurrentModeType));
            hpLabel.text         = SurvivalMode.GetInstance().HP.ToString();
            lifeTimeLabel.text   = string.Format("{0:F1}s", TimeRushMode.GetInstance().LifeTime);
            wordLabel.text       = WordMode.GetInstance().WordText;
            foreach (UISprite cardSprite in cardArray)
            {
                cardSprite.gameObject.SetActive(false);
            }

            for (int i = 0; i < modeContents.Length; i++)
            {
                modeContents[i].SetActive(i == (int)GameSystem.GetInstance().CurrentMode);
            }
        }
    }
Exemplo n.º 4
0
 void HandleOnWordTextChanged()
 {
     wordLabel.text        = WordMode.GetInstance().WordText;
     translationLabel.text = string.Format("({0})", WordMode.GetInstance().WordTranslation);
 }