using System; using I2.Loc; using UnityEngine; using wf; public class DanceSelectMusicInfo { public DanceSelectMusicInfo(GameObject root_obj) { this.root_obj_ = root_obj; this.title_label_ = UTY.GetChildObject(this.root_obj_, "BG/TitleFrame/Value", false).GetComponent(); Transform transform = this.root_obj_.transform.Find("BG/InfoFrame/Value"); if (transform) { this.info_label_ = transform.GetComponent(); } this.dance_num_label_ = UTY.GetChildObject(this.root_obj_, "BG/InfoFrame/Value2", false).GetComponent(); this.image_sprite_ = UTY.GetChildObject(this.root_obj_, "BG/Image", false).GetComponent(); } public void Release() { this.image_sprite_.sprite2D = null; } public void SetDanceData(DanceData data) { this.title_label_.text = data.title.Replace("\n", string.Empty); Localize component = this.title_label_.GetComponent(); if (component != null) { component.SetTerm(data.titleTerm); } if (this.info_label_) { this.info_label_.text = data.commentary_text; Utility.SetLocalizeTerm(this.info_label_, data.commentaryTextTerm, false); } this.dance_num_label_.text = "ダンス人数 : " + data.select_chara_num + "人"; component = this.dance_num_label_.GetComponent(); if (component != null) { component.TermArgs = new Localize.ArgsPair[] { Localize.ArgsPair.Create(data.select_chara_num.ToString()) }; component.OnLocalize(true); } this.Release(); string text = (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.Challenge) ? data.sample_image_name : data.danceshow_image; Texture2D texture2D = Resources.Load("SceneDanceSelect/Atlas/" + text); Sprite sprite = Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), default(Vector2)); sprite.name = text; this.image_sprite_.sprite2D = sprite; GameMain.Instance.CharacterMgr.status.SetFlag("_ライブ背景", (data.bgType != DanceData.BgType.LiveStage) ? 0 : 1); } public GameObject InfoUI { get { return this.root_obj_; } } private GameObject root_obj_; private UILabel title_label_; private UILabel info_label_; private UILabel dance_num_label_; private UI2DSprite image_sprite_; }