コード例 #1
0
    // Use this for initialization
    void Start()
    {
        ScoreEventDialog newDialog = ScoreEventDialog.Create(mainCamera);

        ScoreEventContext scoreEvent1 = new ScoreEventContext();

        scoreEvent1.Title        = "テストイベントです";
        scoreEvent1.Time         = "開催期間:2017/10/10 11:00~10/24 10:59";
        scoreEvent1.HiScoreLabel = "ハイスコア";
        scoreEvent1.HiScore      = "123123123";

        newDialog.EventList.Add(scoreEvent1);
        newDialog.EventList.Add(scoreEvent1);
        newDialog.EventList.Add(scoreEvent1);
        newDialog.EventList.Add(scoreEvent1);

        newDialog.Show();
    }
コード例 #2
0
ファイル: MainMenuHome.cs プロジェクト: mliuzailin/GitGame
    private void openScoreInfo()
    {
        if (m_ScoreDialog != null ||
            ServerApi.IsExists)
        {
            return;
        }

        SoundUtil.PlaySE(SEID.SE_MENU_OK);

        m_ScoreDialog = ScoreEventDialog.Create(SceneObjReferMainMenu.Instance.m_MainMenuGroupCamera.GetComponent <Camera>());

        int[] event_ids = new int[scoreEventList.Count];
        for (int i = 0; i < scoreEventList.Count; i++)
        {
            event_ids[i] = (int)scoreEventList[i].event_id;
        }
        ServerDataUtilSend.SendPacketAPI_GetUserScoreInfo(event_ids)
        .setSuccessAction((data) =>
        {
            RecvGetUserScoreInfo scoreInfo = data.GetResult <RecvGetUserScoreInfo>();
            if (scoreInfo != null &&
                scoreInfo.result != null &&
                scoreInfo.result.score_infos != null)
            {
                for (int i = 0; i < scoreInfo.result.score_infos.Length; i++)
                {
                    PacketStructUserScoreInfo Info = scoreInfo.result.score_infos[i];
                    if (Info == null)
                    {
                        continue;
                    }

                    MasterDataScoreEvent scoreEventMaster = scoreEventList.Find((m) => m.event_id == Info.event_id);
                    if (scoreEventMaster == null)
                    {
                        continue;
                    }

                    m_ScoreDialog.addScoreInfo(Info, scoreEventMaster);
                }


                bool isTutorial = (LocalSaveManagerRN.Instance.GetIsShowTutorialDialog(TutorialDialog.FLAG_TYPE.SCORE) == false);
                if (isTutorial)
                {
#if BUILD_TYPE_DEBUG
                    Debug.LogError(string.Format("チュートリアルを表示する FLAG_TYPE:{0}", TutorialDialog.FLAG_TYPE.SCORE.ToString()));
#endif
                    TutorialDialog.Create().SetTutorialType(TutorialDialog.FLAG_TYPE.SCORE).Show(() =>
                    {
                        isTutorial = false;
                    });
                }

                m_HomeMenu.IsViewScoreInfo = false;
                m_ScoreDialog.Show(() =>
                {
                    m_ScoreDialog = null;
                    m_HomeMenu.IsViewScoreInfo = true;
                });
            }
            else
            {
                DestroyObject(m_ScoreDialog.gameObject);
                m_ScoreDialog = null;

                Dialog errorDialog = Dialog.Create(DialogType.DialogOK);
                errorDialog.SetDialogText(DialogTextType.Title, "警告");
                errorDialog.SetDialogText(DialogTextType.MainText, "スコアイベントは開催されていません。");
                errorDialog.SetDialogText(DialogTextType.OKText, "閉じる");
                errorDialog.SetDialogEvent(DialogButtonEventType.OK, () =>
                {
                    m_HomeMenu.IsViewScoreInfo = false;
                });
                errorDialog.Show();
            }
        })
        .setErrorAction((data) =>
        {
            DestroyObject(m_ScoreDialog.gameObject);
            m_ScoreDialog = null;
        })
        .SendStart();
    }