private void Awake() { commandAbility = GetComponentInParent <CommandAbility>(); panelController = GetComponentInParent <PanelController>(); btn = GetComponent <Button>(); btn.onClick.AddListener(Command); btn.onClick.AddListener(ClosePanel); }
private void Awake() { commandAbility = GetComponentInParent <CommandAbility>(); GetComponent <SelectableGameObject>().OnClickEvent += delegate { commandAbility.Use(); }; }