public void UnregisterListener(EBlockMotionEvent motionEvent, Action onEvent) { if (_listeners.ContainsKey(motionEvent)) { _listeners[motionEvent] -= onEvent; } }
private void TryFireEvent(EBlockMotionEvent eventType, KeyCode keyCode) { if (!Input.GetKeyDown(keyCode)) { return; } _owner._listeners.TryGetValue(eventType, out var action); action?.Invoke(); }
public void RegisterListener(EBlockMotionEvent motionEvent, Action onEvent) { if (_listeners.ContainsKey(motionEvent)) { _listeners[motionEvent] += onEvent; return; } _listeners[motionEvent] = onEvent; }