public void OnDrop(PointerEventData eventData) { _dragObject = eventData.pointerDrag.GetComponentInParent <CompoundInventoryView>(); if (_dragObject != null) { if (_model.Unit != null) { _unitUseCompoundMessage.Unit = _model.Unit; _unitUseCompoundMessage.CompoundIndex = _dragObject.Compound.Index; GameMessage.Send(_unitUseCompoundMessage); } } }
public void OnDrop(PointerEventData eventData) { if (!_model.IsEnabled) { return; } _dragObject = eventData.pointerDrag.GetComponentInParent <CompoundInventoryView>(); if (_dragObject != null && (_dragObject.Compound.Type == CompoundType.Armor || _dragObject.Compound.Type == CompoundType.Weapon)) { _compoundEquipMessage.CompoundIndex = _dragObject.Compound.Index; GameMessage.Send(_compoundEquipMessage); } }