public static DualMode GetInstance() { if (instance == null) { instance = new DualMode(); } return(instance); }
// 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; }
public override void Show(bool active) { base.Show(active); if (active) { int score = GameSystem.GetInstance().Score; int gainedCoin = GameSystem.GetInstance().CurrentModeLogic.ShouldGainBouns ? score / Constant.SCORE_TO_COIN : 0; if (GameSystem.GetInstance().IsVIP) { bonusBlockLabel.text = string.Format("+{0} x 2", gainedCoin); } else { bonusBlockLabel.text = string.Format("+{0}", gainedCoin); } totalBlockLabel.text = GameSystem.GetInstance().Coin.ToString(); int bestRecord = PlayerProfile.LoadBestRecord(GameSystem.GetInstance().CurrentMode, GameSystem.GetInstance().CurrentModeType); modeNameLabel.text = TextManager.GetText(string.Format("mode_name_{0}", (int)GameSystem.GetInstance().CurrentMode)); modeTypeNameLabel.text = string.Format("({0})", TextManager.GetText(string.Format("mode_type_name_{0}", (int)GameSystem.GetInstance().CurrentModeType))); if (GameSystem.GetInstance().CurrentModeType == GameSystem.ModeType.PassLevel) { scoreLabel.text = string.Format("{0}/{1}", GameSystem.GetInstance().DisplayWaveNumber, Constant.MAX_PASSLEVEL); newBestRecordLabel.text = string.Format("{0}/{1}", bestRecord, Constant.MAX_PASSLEVEL); //passLevelElement.SetActive(true); nonePassLevelElement.SetActive(false); } else { scoreLabel.text = score.ToString(); bestRecordLabel.text = bestRecord.ToString(); newBestRecordLabel.text = bestRecord.ToString(); //passLevelElement.SetActive(false); nonePassLevelElement.SetActive(true); } if (GameSystem.GetInstance().BrokenRecord) { commonResultPanel.SetActive(false); brokenRecordPanel.SetActive(true); } else { commonResultPanel.SetActive(true); brokenRecordPanel.SetActive(false); } if (score >= popADScore) { adTrigger.ToShow(true); } if (GameSystem.GetInstance().IsActivated && gainedCoin > 0 && (GameSystem.GetInstance().BrokenRecord || GameSystem.GetInstance().CurrentModeType != GameSystem.ModeType.PassLevel)) { PlayGetBonusAnimation(); } else { bonusAnimationObj.SetActive(false); } for (int i = 0; i < modeContents.Length; i++) { modeContents[i].SetActive(i == (int)GameSystem.GetInstance().CurrentMode); } if (GameSystem.GetInstance().CurrentMode == GameSystem.Mode.Dual) { dualWinnerSprite.color = DualMode.GetInstance().IsLeftWin ? Constant.LEFT_COLOR : Constant.RIGHT_COLOR; } int percent = AchieveData.computePercentByScore(GameSystem.GetInstance().CurrentMode, GameSystem.GetInstance().CurrentModeType, score); achieveLabel.text = string.Format(TextManager.GetText("achieve_desc"), percent); } }