ProcessState_CurvedUI.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ChivaXR;
  5. using Sirenix.OdinInspector;
  6. public class ProcessState_CurvedUI : MonoBehaviour, IProcessState
  7. {
  8. public List<CurvedUIInfo> curvedUIInfos = new List<CurvedUIInfo>();
  9. [LabelText("是否激活")]
  10. [ReadOnly]
  11. public bool active = true;
  12. public void EnterState(bool enterCurrent)
  13. {
  14. if (Application.isPlaying)
  15. {
  16. if (active)
  17. {
  18. for (int i = 0; i < curvedUIInfos.Count; i++)
  19. {
  20. if (enterCurrent)
  21. curvedUIInfos[i].OpenUIInfo();
  22. else
  23. curvedUIInfos[i].CloseUIInfo();
  24. }
  25. }
  26. }
  27. else
  28. {
  29. for (int i = 0; i < curvedUIInfos.Count; i++)
  30. {
  31. if (enterCurrent)
  32. curvedUIInfos[i].OpenUIInfo();
  33. else
  34. curvedUIInfos[i].CloseUIInfo();
  35. }
  36. }
  37. }
  38. public void ExitState()
  39. {
  40. for (int i = 0; i < curvedUIInfos.Count; i++)
  41. {
  42. curvedUIInfos[i].CloseUIInfo();
  43. }
  44. }
  45. public void HalfQuit()
  46. {
  47. }
  48. }