protected override void OnInteract(PhonePart part) { if (!part.Disassemblable) { UserFeedback.Instance.ShowInfoMessage("Item can not be disassembled!"); } else { inventory.Add(part); part.Phone.RemovePart(part); } }
public void BuyComponent(PhonePart part) { if (part) { if (account.Debit(part.price)) { var cloned = Instantiate(part); cloned.Phone = part.Phone; cloned.broken = false; _inventory.Add(cloned); Debug.Log($"Bought: {part} for {part.price} $!"); } } }