TeleportPointController.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using UnityEngine;
  2. namespace WS
  3. {
  4. [ObjectSystem]
  5. public class TeleportPointControllerAwakeSystem : AwakeSystem<TeleportPointController>
  6. {
  7. public override void Awake(TeleportPointController self)
  8. {
  9. self.RefreshTeleport();
  10. }
  11. }
  12. [ObjectSystem]
  13. public class TeleportPointControllerUpdataSystem : UpdateSystem<TeleportPointController>
  14. {
  15. public override void Update(TeleportPointController self)
  16. {
  17. //if (GameManager.Instance.Data.Pattern != PatternType.引导)
  18. //{
  19. // if (VRInputComponent.Instance.Getkey(VRKey.圆盘, VRHand.Any))
  20. // {
  21. // self.ShowTeleportTarget(true);
  22. // }
  23. // else
  24. // {
  25. // self.ShowTeleportTarget(false);
  26. // }
  27. //}
  28. }
  29. }
  30. public class TeleportPointController : WSComponent
  31. {
  32. //public TeleportTargetBase[] points;
  33. public GameObject[] UnMoveAreas;
  34. public void RefreshTeleport()
  35. {
  36. //points = GameObject.FindObjectsOfType<TeleportTargetBase>();
  37. //UnMoveAreas = GameObject.FindGameObjectsWithTag("UnMoveArea");
  38. //for (int i = 0; i < points.Length; i++)
  39. //{
  40. // points[i].GetComponent<MeshRenderer>().enabled = false;
  41. // points[i].GetComponent<Collider>().enabled = false;
  42. //}
  43. //for (int i = 0; i < UnMoveAreas.Length; i++)
  44. //{
  45. // UnMoveAreas[i].GetComponent<Collider>().enabled = false;
  46. //}
  47. }
  48. public void ShowTeleportTarget(bool isShow)
  49. {
  50. //points = GameObject.FindObjectsOfType<TeleportTargetBase>();
  51. //UnMoveAreas = GameObject.FindGameObjectsWithTag("UnMoveArea");
  52. //for (int i = 0; i < points.Length; i++)
  53. //{
  54. // if (points[i]==null)
  55. // {
  56. // return;
  57. // }
  58. // points[i].GetComponent<MeshRenderer>().enabled = isShow;
  59. // points[i].GetComponent<Collider>().enabled = isShow;
  60. //}
  61. //for (int i = 0;i < UnMoveAreas.Length; i++)
  62. //{
  63. // UnMoveAreas[i].GetComponent<Collider>().enabled =isShow;
  64. //}
  65. }
  66. public void InitTeleportArea()
  67. {
  68. //for (int i = 0; i < points.Length; i++)
  69. //{
  70. // points[i].GetComponent<MeshRenderer>().enabled = false;
  71. // points[i].GetComponent<Collider>().enabled = false;
  72. //}
  73. //for (int i = 0; i < UnMoveAreas.Length; i++)
  74. //{
  75. // UnMoveAreas[i].GetComponent<Collider>().enabled = false;
  76. //}
  77. }
  78. public override void Dispose()
  79. {
  80. base.Dispose();
  81. //points = null;
  82. }
  83. }
  84. }