示例#1
0
        override public void Setup(PopupConfig genericConfig)
        {
            base.Setup(genericConfig);
            var config = genericConfig as GenericPopupConfig;

            bannerText.text = config.title;
            mainText.text   = config.mainText;
        }
        override public void Setup(PopupConfig genericConfig)
        {
            base.Setup(genericConfig);
            var config = genericConfig as SettingsPopupConfig;

            bannerText.text     = config.title;
            appVersionText.text = config.appVersion;
            userIDText.text     = config.userID;

            musicToggle.isOn = GlobalState.User.settings.musicOn;
            musicToggle.onValueChanged.AddListener(value => GlobalState.User.settings.musicOn = value);

            sfxToggle.isOn = GlobalState.User.settings.sfxOn;
            sfxToggle.onValueChanged.AddListener(value => GlobalState.User.settings.sfxOn = value);
        }
        override public void Setup(PopupConfig genericConfig)
        {
            base.Setup(genericConfig);
            var config = genericConfig as WinLevelPopupConfig;

            for (long starIndex = 0, filledStars = config.stars; starIndex < filledStars; ++starIndex)
            {
                starPositions[starIndex].GetComponent <Image>().sprite = filledStar;
            }

            score.text    = "Score: " + config.score.ToString("N0");
            topScore.text = "Top Score: " + config.topScore.ToString("N0");

            GlobalState.EventService.Dispatch(new TutorialProgressEvent(TutorialTrigger.PostLevelPopup, config.level));
        }
        override public void Setup(PopupConfig genericConfig)
        {
            base.Setup(genericConfig);
            config = genericConfig as PreLevelPopupConfig;

            bannerText.text = "Level " + config.level.ToString();

            for (long starIndex = 0, filledStars = config.stars; starIndex < filledStars; ++starIndex)
            {
                starPositions[starIndex].GetComponent <Image>().sprite = filledStar;
            }

            config.closeActions = new List <Action> {
                () => GlobalState.SceneService.Reset()
            };
            config.affirmativeActions = new List <Action> {
                TransitionToLevel
            };

            GlobalState.EventService.Dispatch(new TutorialProgressEvent(TutorialTrigger.PreLevelPopup, config.level));
        }
示例#5
0
 virtual public void Setup(PopupConfig config)
 {
     genericConfig = config;
 }
 public void EnqueueWithDelay(float delay, PopupConfig config)
 {
     StartCoroutine(DelayedEnqueue(delay, config));
 }
 public void Enqueue(PopupConfig config)
 {
     popupQueue.Enqueue(config, (int)config.Priority);
     ShowNextPopup();
 }
        private IEnumerator DelayedEnqueue(float delay, PopupConfig config)
        {
            yield return(new WaitForSeconds(delay));

            Enqueue(config);
        }