VREventTrigger.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using UnityEngine;
  3. public class VREventTrigger : MonoBehaviour
  4. {
  5. public void Awake()
  6. {
  7. this.m_collider = base.GetComponent<Collider>();
  8. }
  9. protected virtual void Start()
  10. {
  11. }
  12. public virtual float GetTimeOutTime()
  13. {
  14. if (this.m_bTimeOutDefault)
  15. {
  16. return VREventTrigger.m_fTimeOutDefault;
  17. }
  18. return this.m_fTimeOut;
  19. }
  20. public void SetEnableEvent(bool f_bEnable)
  21. {
  22. this.m_bEnable = f_bEnable;
  23. }
  24. public bool IsEnableEvent()
  25. {
  26. return this.m_bEnable;
  27. }
  28. public void SetEnableCollider(bool f_bEnable)
  29. {
  30. this.m_collider.enabled = f_bEnable;
  31. }
  32. public bool IsEnableCollider()
  33. {
  34. return this.m_collider.enabled;
  35. }
  36. public string GetEventName()
  37. {
  38. return this.m_strEventName;
  39. }
  40. public virtual void StartScript()
  41. {
  42. if (this.m_bEnable)
  43. {
  44. bool flag = false;
  45. if (!string.IsNullOrEmpty(this.m_strScriptFileName))
  46. {
  47. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  48. GameMain.Instance.ScriptMgr.LoadAdvScenarioScript(((!(maid == null)) ? ScriptManager.ReplacePersonal(maid, this.m_strScriptFileName) : this.m_strScriptFileName) + ".ks", string.Empty);
  49. flag = true;
  50. }
  51. if (!string.IsNullOrEmpty(this.m_strScriptLabel))
  52. {
  53. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strScriptLabel);
  54. flag = true;
  55. }
  56. if (flag)
  57. {
  58. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  59. }
  60. }
  61. }
  62. public virtual void OnEvnetCountDownEnter(GameObject f_goSrc)
  63. {
  64. }
  65. public virtual void OnEventCountDownExit(GameObject f_goSrc)
  66. {
  67. }
  68. public static float m_fTimeOutDefault = 3f;
  69. public bool m_bTimeOutDefault;
  70. public float m_fTimeOut = 3f;
  71. public string m_strEventName;
  72. public string m_strScriptFileName;
  73. public string m_strScriptLabel;
  74. public bool m_bEnable = true;
  75. private Collider m_collider;
  76. }