using System.Collections; using System.Collections.Generic; using UnityEngine; using Sirenix.OdinInspector; namespace KairoEngine.UI.InteractionHandler { [HideMonoScript] public class ClickHandler : MonoBehaviour { [InfoBox("Control this button dynamicly thru a parent object that implements the ClickHandler interface. Trigger the OnClick function on this script thru the Button Component.")] public string title = ""; [ShowInInspector, ReadOnly, ShowIf("@receiver != null")] public IClickHandler receiver; public void OnClick() { if(receiver != null) receiver.OnClick(title); //else Debug.LogError("ClickHandler has no receiver!", this.gameObject); } } }