예제 #1
0
    public Popup_LevelInfo Setup(SeasonModel season, int index, bool startLevelButton)
    {
        var levelmodel = season.GetLevelModel(index, Profile.Skill);

        title.SetFormatedText(season.id + 1, GlobalFactory.Seasons.GetLevelNumber(season.id, index + 1));
        ballsLabel.SetFormatedText(levelmodel.startBallCount);
        allitemsDesc.SetActive(levelmodel.IsTargetExist == false);
        targetItemsDesc.SetActive(levelmodel.IsTargetExist == true);

        var ballsprite = GlobalFactory.Balls.GetSprite(Profile.Avatar.BallId);

        foreach (var ballimage in ballImages)
        {
            ballimage.sprite = ballsprite;
        }

        targetItem0Image.sprite = GlobalFactory.Theme.Selected.items[0];
        targetItem1Image.sprite = GlobalFactory.Theme.Selected.items[1];

        targetItem0Label.text  = levelmodel.targetItem0.ToString();
        targetItem1Label.text  = levelmodel.targetItem1.ToString();
        targetBallsLabel.text  = levelmodel.targetBalls.ToString();
        targetBlocksLabel.text = levelmodel.targetBlocks.ToString();

        targetItem0Label.transform.parent.gameObject.SetActive(levelmodel.targetItem0 > 0);
        targetItem1Label.transform.parent.gameObject.SetActive(levelmodel.targetItem1 > 0);
        targetBallsLabel.transform.parent.gameObject.SetActive(levelmodel.targetBalls > 0);
        targetBlocksLabel.transform.parent.gameObject.SetActive(levelmodel.targetBlocks > 0);

        startButton.onClick.AddListener(() =>
        {
            if (startLevelButton)
            {
                if (StoryLogic.SetPlayModel(season, index))
                {
                    Back();
                    StoryLogic.StartPlaying(null);
                }
            }
            else
            {
                Back();
            }
        });

        return(this);
    }
예제 #2
0
        private void TransitionToStory()
        {
            if (transitionFinished)
            {
                return;
            }
            Scene storyScene = new Scene();

            storyScene.RegisterMatchSoundManager(scene.MatchSoundManager);

            Logic storyLogic = new StoryLogic(director, storyScene, selectedPlayers);

            storyLogic.Initialize();
            Screen storyScreen = new DefaultScreen(director, storyScene, storyLogic.BaseScreenSize);

            director.TransitionToLogic(storyLogic);
            director.TransitionToScreen(storyScreen, 3, -1);

            transitionFinished = true;
        }
예제 #3
0
        private int userId = 1; //TODO this needs to take from Identity. When Authentication is built.

        public StoryController(StoryLogic logic)
            : base()
        {
            logger.Info("Created: StoryController");
            _logic = logic;
        }