protected override IEnumerator Start() { var settings = (FinalScoreScreenSettings)ApplicationManager.instance.menuSettings.screenSettings .First(x => x.GetScreenType() == Settings.ScreenSettings.ScreenType.FinalScoreScreen); _audioClipPath = settings.audioPath; _titleText.InitTranslatedText(settings.title); _finalScoreLabelText.InitTranslatedText(settings.scoreText); _precisionLabelText.InitTranslatedText(settings.precisionText); _speedLabelText.InitTranslatedText(settings.speedText); _bestScoreLabelText.InitTranslatedText(settings.bestScoreText); _thanksText.InitTranslatedText(settings.thanksText); _ptsTextValue = settings.ptsText; _finalScoreTextValue = settings.scoreText; _finalScoreP2TextValue = !string.IsNullOrEmpty(settings.scoreP2Text.key) ? settings.scoreP2Text : settings.scoreText; foreach (Transform star in _precisionFill) { _precisionStarPosition.Add(star.position); } foreach (Transform star in _speedFill) { _speedStarPosition.Add(star.position); } yield return(base.Start()); }
public void Init(SurveyAnswer answer, Color color) { _color = color; if (_button == null) { _button = GetComponentInChildren <Button>(); } _button.onClick.AddListener(() => { onAnswer(answer.key, answer.buttonAction, this); }); _text.InitTranslatedText(answer.key); _highlightedText.InitTranslatedText(answer.key); _highlightedText.GetComponent <Text>().color = color; _background.color = color; }
public void Init(SurveyQuestion question, int index, int playerIndex, Color color1, Color color2) { _index = index; _questionKey = question.key; _playerIndex = playerIndex; _text.InitTranslatedText(_questionKey); int i = 0; foreach (SurveyAnswer answer in question.answers) { var button = GameObject.Instantiate(_buttonPrefab, _buttonPanel); button.Init(answer, i % 2 == 0 ? color1 : color2); button.onAnswer += OnAnswer; _buttonList.Add(button); i++; } }
protected override IEnumerator Start() { yield return base.Start(); CreditsSettings settings = ((CreditsSettings)ApplicationManager.instance.menuSettings.screenSettings .First(x => x.GetScreenType() == ScreenSettings.ScreenType.Credits)); StringCommon title = settings.title; StringCommon marginText = settings.marginText; StringCommon leftText = settings.leftContent.text; StringCommon leftCopyright = settings.leftContent.copyright; StringCommon rightText = settings.rightContent.text; StringCommon rightCopyright = settings.rightContent.copyright; _preferedTextureMinSize = settings.preferedMinTextureSize; _titleText.InitTranslatedText(title); _marginText.InitTranslatedText(marginText); _contentLeftText.InitTranslatedText(leftText); _copyrightLeftText.InitTranslatedText(leftCopyright); _contentRightText.InitTranslatedText(rightText); _copyrightRightText.InitTranslatedText(rightCopyright); InitLogos(_logosLeftPanel, settings.leftContent.logos, TextureManager.instance); InitLogos(_logosRightPanel, settings.rightContent.logos, TextureManager.instance); }
public override void Init(ContentPageSettings contentPageSettings) { base.Init(contentPageSettings); _content.InitTranslatedText(contentPageSettings.content); if (!String.IsNullOrEmpty(contentPageSettings.imagePath.key) && TextureManager.instance.HasTexture(contentPageSettings.imagePath.key)) { _rawImage.texture = TextureManager.instance.GetTexture(contentPageSettings.imagePath); } if (contentPageSettings.gif != null) { _frames = LoadGif(contentPageSettings.gif); _framerate = contentPageSettings.gif.framerate; } if (AudioManager.instance.HasClip(contentPageSettings.audioPath.key)) { _audioClipPath = contentPageSettings.audioPath; } _videoTexture.enabled = !String.IsNullOrEmpty(contentPageSettings.videoPath.key); if (_videoTexture.enabled) { _videoClipPath = contentPageSettings.videoPath.key; } }
private void Init() { Color p1Color = Color.white; Color p2Color = Color.white; _surveyQuestionsP1 = new List <UISurveyQuestion>(); _surveyQuestionsP2 = new List <UISurveyQuestion>(); var surveyQuestions = ApplicationManager.instance.menuSettings.surveySettings.surveyQuestions; _titleP1.InitTranslatedText(ApplicationManager.instance.menuSettings.surveySettings.p1titlekey); _titleP2.InitTranslatedText(ApplicationManager.instance.menuSettings.surveySettings.p2titlekey); if (ColorUtility.TryParseHtmlString(ApplicationManager.instance.appSettings.p1Color, out p1Color)) { _backgroundCanvasP1.color = p1Color; } if (ColorUtility.TryParseHtmlString(ApplicationManager.instance.appSettings.p2Color, out p2Color)) { _backgroundCanvasP2.color = p2Color; } for (int i = 0; i < surveyQuestions.Length; i++) { var question = surveyQuestions[i]; UISurveyQuestion go1 = GameObject.Instantiate(_surveyQuestionPrefab, _panelP1.transform); UISurveyQuestion go2 = GameObject.Instantiate(_surveyQuestionPrefab, _panelP2.transform); go1.Init(question, i, 0, _buttonColor1, _buttonColor2); go2.Init(question, i, 1, _buttonColor1, _buttonColor2); go1.interactable = go2.interactable = (i == 0); _surveyQuestionsP1.Add(go1); _surveyQuestionsP2.Add(go2); } _answersP1 = new QuestionAnswerKeys[_surveyQuestionsP1.Count]; _answersP2 = new QuestionAnswerKeys[_surveyQuestionsP2.Count]; }
public virtual void Init(TPageSettings pageSettings) { _title.InitTranslatedText(pageSettings.title); _displayNext = pageSettings.displayNext; _nextStyle = pageSettings.nextStyle; }