void Update() { if (_action != null) { //отмена if (Input.GetMouseButtonDown(1)) { _action = null; OnActiveTarget?.Invoke(_action, _source); } } }
public void ActiveTarget(TargetAction action, ITargetSource source = null) { _source = source; _action = action; OnActiveTarget?.Invoke(_action, _source); }