public IDisposable AddOnCancel(Action cancelAction) { lock (m_onCancelActions) { OnCancelAction res = new OnCancelAction(cancelAction, this); m_onCancelActions.Add(res); return(res); } }
// Update is called once per frame void Update() { //EquipSystem equipSystem = GetComponent<EquipSystem>(); if (Input.GetButtonDown("Interact") && itemInView != null) { //Interacting with objects in the world itemInView.GetComponent <Interactable>().OnInteract(gameObject); } if (Input.GetButtonDown("Cancel")) { OnCancelAction?.Invoke(); } }
public SetFilterValueViewModel() { filtersDictionary = FiltersHelper.GetFiltersObjects().ToDictionary(x => x.Filter, x => x.Description); SaveCommand = ReactiveCommand.Create(() => { OnSaveAction?.Invoke(); FinishInteraction?.Invoke(); }); CancelCommand = ReactiveCommand.Create(() => { OnCancelAction?.Invoke(); FinishInteraction?.Invoke(); }); }
public void Cancel() { OnCancelAction?.Invoke(); }