void Start() { if (UpdateHealth == null) { UpdateHealth = new UIEvent(); } if (UpdateHUD == null) { UpdateHUD = new HUDEvent(); } UpdateHealth.AddListener(UpdateHealthBar); UpdateHUD.AddListener(UpdateUI); }
private void Awake() { popUpText = PopUpItemPickup.GetComponentInChildren <TextMeshProUGUI>(); EnableItemPickup = new UIEvent(); DisableItemPickup = new UIEvent(); UIItemGotSelected = new UIEvent(); InventoryOpened = new UnityEvent(); InventoryClosed = new UnityEvent(); UIItemGotSelected.AddListener(FillSelectedItemPanel); EnableItemPickup.AddListener(EnableItemPopUp); DisableItemPickup.AddListener(DisableItemPopUp); PopUpItemPickup.SetActive(false); InventoryContainer.SetActive(false); PlayerController.inventory.InventoryChanged.AddListener(GenerateInventory); ClearSelectedItemPanel(); }
public void SetListener(UnityAction _action) { attackEvent.AddListener(_action); }
public void SetListener(UnityAction callBack) { m_OnClick.RemoveAllListeners(); m_OnClick.AddListener(callBack); }