PhotoNoCharaActive.cs 1.2 KB

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