private void BuyItem(PodPart podPart) { if (MoneyManager.instance.WithdrawMoney(podPart.price)) { Debug.Log("bought an item : " + podPart.name); PodManager.instance.collection[PodManager.instance.selectedPod].InstallPodPart(podPart); Refresh(); } else { Debug.Log("couldn't buy " + podPart.name); } }
public void InstallPodPart(PodPart part) { EnginePodPart engine = part as EnginePodPart; if (engine != null) { InstallEngine(engine); } InjectorPodPart injector = part as InjectorPodPart; if (injector != null) { InstallInjector(injector); } }