DanceSelectMusicInfo.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using UnityEngine;
  3. public class DanceSelectMusicInfo
  4. {
  5. public DanceSelectMusicInfo(GameObject root_obj)
  6. {
  7. this.root_obj_ = root_obj;
  8. this.title_label_ = UTY.GetChildObject(this.root_obj_, "BG/TitleFrame/Value", false).GetComponent<UILabel>();
  9. Transform transform = this.root_obj_.transform.Find("BG/InfoFrame/Value");
  10. if (transform)
  11. {
  12. this.info_label_ = transform.GetComponent<UILabel>();
  13. }
  14. this.dance_num_label_ = UTY.GetChildObject(this.root_obj_, "BG/InfoFrame/Value2", false).GetComponent<UILabel>();
  15. this.image_sprite_ = UTY.GetChildObject(this.root_obj_, "BG/Image", false).GetComponent<UI2DSprite>();
  16. }
  17. public void Release()
  18. {
  19. this.image_sprite_.sprite2D = null;
  20. }
  21. public void SetDanceData(DanceData data)
  22. {
  23. this.title_label_.text = data.title.Replace("\n", string.Empty);
  24. if (this.info_label_)
  25. {
  26. this.info_label_.text = data.commentary_text;
  27. }
  28. this.dance_num_label_.text = "ダンス人数 : " + data.select_chara_num + "人";
  29. this.Release();
  30. string text = (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.Challenge) ? data.sample_image_name : data.danceshow_image;
  31. Texture2D texture2D = Resources.Load<Texture2D>("SceneDanceSelect/Atlas/" + text);
  32. Sprite sprite = Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), default(Vector2));
  33. sprite.name = text;
  34. this.image_sprite_.sprite2D = sprite;
  35. GameMain.Instance.CharacterMgr.status.SetFlag("_ライブ背景", (data.bgType != DanceData.BgType.LiveStage) ? 0 : 1);
  36. }
  37. public GameObject InfoUI
  38. {
  39. get
  40. {
  41. return this.root_obj_;
  42. }
  43. }
  44. private GameObject root_obj_;
  45. private UILabel title_label_;
  46. private UILabel info_label_;
  47. private UILabel dance_num_label_;
  48. private UI2DSprite image_sprite_;
  49. }