UIWFHitMasks.cs 817 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using UnityEngine;
  3. public class UIWFHitMasks : MonoBehaviour
  4. {
  5. public void Start()
  6. {
  7. UIWidget component = base.GetComponent<UIWidget>();
  8. if (component != null)
  9. {
  10. foreach (BoxCollider boxCollider in this.Masks)
  11. {
  12. if (!(boxCollider == null))
  13. {
  14. UIWidget component2 = boxCollider.gameObject.GetComponent<UIWidget>();
  15. if (component2 != null)
  16. {
  17. component2.depth = component.depth;
  18. }
  19. }
  20. }
  21. }
  22. }
  23. public new bool enabled
  24. {
  25. get
  26. {
  27. return this.enabled_;
  28. }
  29. set
  30. {
  31. this.enabled_ = value;
  32. if (this.Masks != null)
  33. {
  34. for (int i = 0; i < this.Masks.Length; i++)
  35. {
  36. if (this.Masks[i] != null)
  37. {
  38. this.Masks[i].enabled = this.enabled_;
  39. }
  40. }
  41. }
  42. }
  43. }
  44. public BoxCollider[] Masks;
  45. private bool enabled_;
  46. }