HandEnableDisableNotifier.cs 482 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using UnityEngine;
  3. public class HandEnableDisableNotifier : MonoBehaviour
  4. {
  5. public void OnEnable()
  6. {
  7. if (this.m_aryNotify != null)
  8. {
  9. for (int i = 0; i < this.m_aryNotify.Length; i++)
  10. {
  11. this.m_aryNotify[i].SetActive(true);
  12. }
  13. }
  14. }
  15. public void OnDisable()
  16. {
  17. if (this.m_aryNotify != null)
  18. {
  19. for (int i = 0; i < this.m_aryNotify.Length; i++)
  20. {
  21. this.m_aryNotify[i].SetActive(false);
  22. }
  23. }
  24. }
  25. public GameObject[] m_aryNotify;
  26. }