public void SetData(MusicRhythmRunningInfo info) { _name.text = info.musicName; _level.text = info.diffName; _score.text = info.Socre.ToString(); _combo.text = info.MaxCombo.ToString(); _bg.texture = ResourceManager.Load <Texture>("TrainingRoom/background/" + info.musicId, ModuleConfig.MODULE_MUSICRHYTHM); _perfect.text = I18NManager.Get("MusicRhythm_Perfect", info.Perfect); _good.text = I18NManager.Get("MusicRhythm_Good", info.Good); _bad.text = I18NManager.Get("MusicRhythm_Bad", info.Bad); _miss.text = I18NManager.Get("MusicRhythm_Miss", info.Miss); string iconPath = "UIAtlas_MusicRhythm_Level" + info.gameScoreLevel.ToString(); Image level = transform.GetImage("BottomBg/ScoreBg/Image"); level.sprite = AssetManager.Instance.GetSpriteAtlas(iconPath); level.SetNativeSize(); _cover.texture = ResourceManager.Load <Texture>("TrainingRoom/cover1/" + info.musicId, ModuleConfig.MODULE_MUSICRHYTHM); var playerVo = GlobalData.PlayerModel.PlayerVo; _nameText.text = playerVo.UserName; _levelText.text = "Lv." + playerVo.Level; var userOther = GlobalData.PlayerModel.PlayerVo.UserOther; _headIcon.texture = ResourceManager.Load <Texture>(GlobalData.DiaryElementModel.GetHeadPath(userOther.Avatar, ElementTypePB.Avatar)); _headFrame.texture = ResourceManager.Load <Texture>(GlobalData.DiaryElementModel.GetHeadPath(userOther.AvatarBox, ElementTypePB.AvatarBox)); }
public void SetData(MusicRhythmRunningInfo info, MusicGameType musicGameType) { _data = info; _bg.texture = ResourceManager.Load <Texture>("TrainingRoom/background/" + info.musicId, ModuleConfig.MODULE_MUSICRHYTHM); _name.text = info.musicName; _level.text = info.diffName; _score.text = info.Socre.ToString(); _combo.text = info.MaxCombo.ToString(); _perfect.text = I18NManager.Get("MusicRhythm_Perfect", info.Perfect); _good.text = I18NManager.Get("MusicRhythm_Good", info.Good); _bad.text = I18NManager.Get("MusicRhythm_Bad", info.Bad); _miss.text = I18NManager.Get("MusicRhythm_Miss", info.Miss); string iconPath = "UIAtlas_MusicRhythm_Level" + info.gameScoreLevel.ToString(); Image level = transform.GetImage("BottomBg/ScoreBg/Image"); level.sprite = AssetManager.Instance.GetSpriteAtlas(iconPath); level.SetNativeSize(); _cover.texture = ResourceManager.Load <Texture>("TrainingRoom/cover1/" + info.musicId, ModuleConfig.MODULE_MUSICRHYTHM); switch (musicGameType) { case MusicGameType.Activity: case MusicGameType.TrainingRoomPractice: _restart.onClick.AddListener(() => { SendMessage(new Message(MessageConst.MODULE_MUSICRHYRHM_RESTARTGAME)); }); break; case MusicGameType.TrainingRoom: transform.Find("BottomBg/ScoreBg/Reward").gameObject.Show(); _restart.transform.GetText("Text").text = "继续"; _restart.onClick.AddListener(() => { SendMessage(new Message(MessageConst.MODULE_MUSICRHYRHM_BACK)); }); break; } }
public void ShareMusicGameResult(MusicRhythmRunningInfo data) { IconSelectWindow win = PopupManager.ShowWindow <IconSelectWindow>(Constants.IconSelectWindowPath); win.clickCallback = (m) => { ScreenShotUtil.ScreenShot(ScreenShotType.MusicGame, (imageUrl) => { ScreenShotCallback(m, imageUrl, ShareTypePB.ShareClothes); }, data); }; win.SetData( I18NManager.Get("Common_ShareTo"), IconType.WeChatFriend, IconType.WeChatFriendCircle, IconType.QQFriend, IconType.SinaWeibo ); }
public void InitRunningData(float musicLen) { runningInfo = new MusicRhythmRunningInfo(); int musicId = _activityMusicVo.MusicId; //LoadJson("10000"); //LoadJson("10001"); //LoadJson("10002"); MusicGameDiffTypePB diff = _activityMusicVo.Diff; string jsonId = musicId.ToString() + ((int)diff).ToString(); Debug.LogError(jsonId); _rhythmInInfo = LoadJson(jsonId); _rhythmInInfo.Ticks.Sort(); runningInfo.activityId = _activityMusicVo.ActivityId; runningInfo.diff = _activityMusicVo.Diff; runningInfo.musicLen = musicLen; runningInfo.musicId = musicId; runningInfo.musicName = GetMusicNameById(musicId); runningInfo.ScoreRule = GetMusicGameScoreRule(musicId, diff); runningInfo.JudgeMusicDataPBs = GetJudgeRule(); }