12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- 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<UILabel>();
- Transform transform = this.root_obj_.transform.Find("BG/InfoFrame/Value");
- if (transform)
- {
- this.info_label_ = transform.GetComponent<UILabel>();
- }
- this.dance_num_label_ = UTY.GetChildObject(this.root_obj_, "BG/InfoFrame/Value2", false).GetComponent<UILabel>();
- this.image_sprite_ = UTY.GetChildObject(this.root_obj_, "BG/Image", false).GetComponent<UI2DSprite>();
- }
- 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<Localize>();
- 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<Localize>();
- 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<Texture2D>("SceneDanceSelect/Atlas/" + text);
- if (!texture2D)
- {
- texture2D = ImportCM.CreateTexture(text + ".tex");
- }
- if (texture2D)
- {
- 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("_ライブ背景", DanceData.DANCEBG_FLAGVAL_PAIR[data.bgType]);
- }
- 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_;
- }
|