public void OnClick() { if (b_isItemOutside) { _selectedItem.GetDropAction()(); _selectedItem.SetDragged(false); Destroy(_selectedItem.gameObject); _selectedItem = null; b_isItemOutside = false; return; } foreach (UIContainer container in _uiContainers) { if (!container.CanHostItem(_selectedItem)) { continue; } if (_selectedItem != null) { if (!_selectedItem.IsValid()) { return; } } _selectedItem = container.ReplaceItem(_selectedItem); break; } }