示例#1
0
    public void OnStageMessage(bool display, ClearStageData stageData)
    {
        if (display)
        {
            Open();

            if (popupMessage.activeInHierarchy)
            {
                popupMessage.SetActive(false);
            }

            stageMessage.gameObject.SetActive(display);

            windowsTitleText.text  = m_build.MessageTitle;
            stageMessageScore.text = $"{m_build.MessageText}";

            for (int i = 0; i < stageData.star; ++i)
            {
                stageMessageFillStars[i].sprite = manager.fillStarSprite;
            }

            CreateButton(m_build.GetButton(), true);
        }

        else
        {
            for (int i = 0; i < 3; ++i)
            {
                stageMessageFillStars[i].sprite = manager.emptyStarSprite;
            }

            DestroyButton();
            Close();
        }
    }
示例#2
0
    public void SetStageMessage(ClearStageData stage)
    {
        StaticVariables.LoadLevel = stage.level;

        MessageWindow message = uImgr.GetWindow(Menus.Message) as MessageWindow;

        message.m_build = new MessageBuilder().
                          SetMessageTitle(StaticVariables.SelectStageName).
                          SetMessageText($"{StaticVariables.Score}{stage.score.ToString("D8")}").
                          SetButtonsInfo(ButtonColor.YellowButton, StaticVariables.GameStart, () => GameManager.Instance.SceneLoad("Game")).
                          SetButtonsInfo(ButtonColor.GreenButton, StaticVariables.Back, () => message.OnStageMessage(false, stage)).
                          Build();

        message.OnStageMessage(true, stage);
    }
示例#3
0
    public void StageResult(StageState result)
    {
        ClearStageData stageData      = PlayerSystemToJsonData.playerData.GetStageData(StaticVariables.LoadLevel);
        MessageBuilder messageBuilder = new MessageBuilder();
        StringBuilder  sb             = new StringBuilder();

        sb.Append($"{StaticVariables.Score}{stageData.score.ToString("D8")}");

        switch (result)
        {
        case StageState.Clear:
            messageBuilder.SetMessageTitle($"{StaticVariables.SelectStageName} {StaticVariables.Clear}");
            googleMgr.ClearAchievements();
            if (StaticVariables.LoadLevel < stageData_SO.stageDatas.Count)
            {
                ++StaticVariables.LoadLevel;
                messageBuilder.SetButtonsInfo(ButtonColor.YellowButton, StaticVariables.NextStage, () => SceneLoad("Game"));
            }

            else
            {
                sb.Append("\nTHANK YOU FOR PLAY !!");
            }

            messageBuilder.SetButtonsInfo(ButtonColor.GreenButton, StaticVariables.Back, () => SceneLoad("StageSelect"));
            break;

        case StageState.Fail:
            messageBuilder.SetMessageTitle($"{StaticVariables.SelectStageName} {StaticVariables.Fail}");
            messageBuilder.SetMessageText("다시 도전해보세요...");
            messageBuilder.SetButtonsInfo(ButtonColor.YellowButton, StaticVariables.Replay, () => SceneLoad("Game"));
            messageBuilder.SetButtonsInfo(ButtonColor.GreenButton, StaticVariables.Back, () => SceneLoad("StageSelect"));
            admobMgr.Show();
            break;
        }
        messageBuilder.SetMessageText(sb.ToString());

        MessageWindow message = uIMgr.GetWindow(Menus.Message) as MessageWindow;

        message.m_build = messageBuilder.Build();
        message.OnStageMessage(true, stageData);
    }
示例#4
0
    public void InitStageNode(ClearStageData stage)
    {
        uImgr = UImenu.manager;

        for (int i = 0; i < stage.star; ++i)
        {
            fillStars[i].sprite = uImgr.fillStarSprite;
        }

        stageNodeImage = GetComponent <Image>();
        if (stage.score > 0)
        {
            stageNodeImage.sprite = uImgr.clearStageNodeSprites[stage.level - 1];
        }

        else
        {
            stageNodeImage.sprite = uImgr.firstStageNodeSprite;
        }

        stageNodeButton = GetComponent <Button>();
        stageNodeButton.onClick.AddListener(() => SetStageMessage(stage));
    }