PhotoNoCharaActive.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using I2.Loc;
  3. using UnityEngine;
  4. public class PhotoNoCharaActive : MonoBehaviour
  5. {
  6. public void Awake()
  7. {
  8. this.label = base.GetComponentInChildren<UILabel>();
  9. this.label.text = this.drawText;
  10. Localize localize = this.label.gameObject.AddComponent<Localize>();
  11. if (localize != null)
  12. {
  13. localize.SetTerm("ScenePhotoMode/" + this.drawText);
  14. }
  15. this.label.enabled = false;
  16. this.backupPos = this.mainContent.localPosition;
  17. }
  18. public void ChangeMode(bool isNoChara, bool windowsResize = true)
  19. {
  20. if (isNoChara)
  21. {
  22. if (windowsResize)
  23. {
  24. Vector2 vector = this.basePhotoWindow.WindowSize;
  25. this.basePhotoWindow.WindowSize = this.windowSize;
  26. this.basePhotoWindow.ResizeWindow();
  27. this.basePhotoWindow.WindowSize = vector;
  28. }
  29. this.label.enabled = true;
  30. this.mainContent.localPosition = new Vector3(-6000f, -6000f, -6000f);
  31. }
  32. else
  33. {
  34. if (windowsResize)
  35. {
  36. this.basePhotoWindow.ResizeWindow();
  37. }
  38. this.label.enabled = false;
  39. this.mainContent.localPosition = this.backupPos;
  40. }
  41. }
  42. public string drawText = "アクティブなキャラクターがいません";
  43. public int fontSize = 22;
  44. public Vector2 windowSize = new Vector2(380f, 80f);
  45. public BasePhotoWindow basePhotoWindow;
  46. public Transform mainContent;
  47. private Vector3 backupPos;
  48. private UILabel label;
  49. }