ColliderEvent.cs 329 B

12345678910111213141516171819202122232425
  1. using System;
  2. using UnityEngine;
  3. public class ColliderEvent : MonoBehaviour
  4. {
  5. private void OnMouseDown()
  6. {
  7. if (this.onMouseDown != null)
  8. {
  9. this.onMouseDown();
  10. }
  11. }
  12. private void OnMouseUp()
  13. {
  14. if (this.onMouseUp != null)
  15. {
  16. this.onMouseUp();
  17. }
  18. }
  19. public Action onMouseDown;
  20. public Action onMouseUp;
  21. }