void Bind()
        {
            //Domain.Entities.Terminologies.FirstOrSecond.Firstをローカルのプレイヤーを指すように変える
            var score = ScoreeUseCaseFactory.Create(Domain.Entities.Terminologies.FirstOrSecond.First).Score;
            var data  = LanguageManager.Instance.Translator.Translate(TranslatableKeys.ScoreLabel);

            scoreText.text = data.Text + score.ToString();
            scoreText.font = data.FontAsset;
        }
        void Bind()
        {
            //Domain.Entities.Terminologies.FirstOrSecond.Firstをローカルのプレイヤーを指すように変える
            var      localPlayerScore  = ScoreeUseCaseFactory.Create(Domain.Entities.Terminologies.FirstOrSecond.First).Score;
            var      remotePlayerScore = ScoreeUseCaseFactory.Create(Domain.Entities.Terminologies.FirstOrSecond.Second).Score;
            TextData resultText;

            if (localPlayerScore == remotePlayerScore)
            {
                resultText = LanguageManager.Instance.Translator.Translate(TranslatableKeys.DrawMessage);
            }
            else if (localPlayerScore > remotePlayerScore)
            {
                resultText = LanguageManager.Instance.Translator.Translate(TranslatableKeys.WinMessage);
            }
            else
            {
                resultText = LanguageManager.Instance.Translator.Translate(TranslatableKeys.LoseMessage);
            }
            scoreText.text = resultText.Text;
            scoreText.font = resultText.FontAsset;
        }
Exemple #3
0
        void OnGameReset(IGame game)
        {
            var scoreUseCase = ScoreeUseCaseFactory.Create(firstOrSecond);

            if (scoreUseCase == null)
            {
                scoreText.enabled = false;
                return;
            }

            Action <Unit> onTurnChanged = _ =>
            {
                var score = scoreUseCase.Score;
                var data  = LanguageManager.Instance.Translator.Translate(scoreTextLabel);
                scoreText.text = data.Text + score.ToString();
                scoreText.font = data.FontAsset;
            };

            scoreText.enabled = true;
            game.OnTurnChanged.TakeUntilDestroy(this).Subscribe(onTurnChanged);

            onTurnChanged(Unit.Default);
        }