ClickHandler.cs 502 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. namespace KairoEngine.UI.InteractionHandler
  6. {
  7. public class ClickHandler : MonoBehaviour
  8. {
  9. public string title = "";
  10. [ShowInInspector] public IClickHandler receiver;
  11. public void OnClick()
  12. {
  13. if(receiver != null) receiver.OnClick(title);
  14. else Debug.LogError("ClickHandler has no receiver!", this.gameObject);
  15. }
  16. }
  17. }