Пример #1
0
    private void Start()
    {
        if (but_Voice != null)
        {
            but_Voice.onClick.AddListener(() => {
                MicManager.Instance.PlayAllVoice(rankObjectDebug.uid,
                                                 StaticData.LevelID,
                                                 () => {
                    anim_btnVoice.SetBool("isPlaying", true);
                },
                                                 () => {
                    LogManager.Log("下载录音失败");
                    anim_btnVoice.SetBool("isPlaying", false);
                });
            });
        }


        if (but_Video != null)
        {
            but_Video.onClick.AddListener(() => {
                JsonData data     = new JsonData();
                data["historyID"] = rankObjectDebug.historyID;
                DancingWordAPI.Instance.RequestLevelDancDataFromServer(data, (string resultData) => {
                    LogManager.Log(resultData);
                    JsonData result = JsonMapper.ToObject(resultData);
                    if (result.TryGetString("code").Equals("1"))
                    {
                        string json = result.TryGetData("data").TryGetData("danceData").TryGetString("danceResult");
                        if (SceneManager.GetActiveScene().name == "BookScene")
                        {
                            StaticData.ChoreographerData = json;
                            LoadSceneManager.Instance.LoadNormalScene("StageScene");
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(json))
                            {
                                PageManager.Instance.CurrentPage.GetNode <ScoreListNode>().Close(true);
                                PageManager.Instance.CurrentPage.GetNode <StageOverNode>().Close(true);
                                ChoreographerData cData = ChoreographerData.GetChoreographerDataFromJson(json);
                                CorePlayManager.Instance.WatchOtherDance(cData);
                            }
                            else
                            {
                                PromptManager.Instance.MessageBox(PromptManager.Type.FloatingTip, "无法获取舞蹈数据");
                            }
                        }
                    }
                }, () => {
                    LogManager.Log("获取过程数据失败!");
                });
            });
        }
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        StaticData.NowLevelData  = LevelConfig.GetLevelDataByID(StaticData.LevelID);
        CorePlayData.SongID      = LanguageManager.GetSongIdFromLanguage(StaticData.NowLevelData.songID);
        CorePlayData.SongScript  = SongConfig.Instance.GetsongScriptBySongIDAndLevelDiffculty(LanguageManager.GetSongIdFromLanguage(StaticData.NowLevelData.songID), StaticData.NowLevelData.LevelDifficulty);
        CorePlayData.SongOffset  = SongConfig.Instance.GetSongOffsetBySongIDAndLevelDiffculty(LanguageManager.GetSongIdFromLanguage(StaticData.NowLevelData.songID), StaticData.NowLevelData.LevelDifficulty);
        CorePlayData.CurrentSong = BeatmapParse.Parse(CorePlayData.SongScript);


        ChoreographerData cData = ChoreographerData.GetChoreographerDataFromJson(StaticData.ChoreographerData);

        loader.LoadAudio();
        m_StageManager.Init(60f / CorePlayData.CurrentSong.BPM);
        m_StageManager.CreateDataFromWholeChoreographer(cData);
        m_StageManager.SetChampion(true);
        m_StageManager.ShowStage();


        AnalysisManager.Instance.OnEvent("enterStage", null);
    }