public void Craft(int amount) { var result = Game.Instance.playerData.Craft(currCraftable, amount); resultUI.Setup(null, result.atomsUsed); var temp = currCraftable; Refresh(); SetCraftable(temp); }
public void Produce() { var result = Game.Instance.playerData.ProduceCombine(atomA, atomB, (int)atomAAmo.value, (int)atomBAmo.value); if (result.atomsProduced.Count > 0 && result.atomsProduced[0].amo > 0 && result.atomsProduced[0].atom.CanBeRenamed()) { resultUI.OnResultUIClick += DisplayRename; atomProduced = result.atomsProduced[0].atom; } // Display Popup resultUI.Setup(result.atomsProduced, result.atomsUsed); Reset(); for (int i = 0; i < result.atomsProduced.Count; i++) { print("Atoms Produced: " + result.atomsProduced[i].atom.GetName() + " " + result.atomsProduced[i].amo); } }
public void Produce() { PlayerData.AtomCollisionResult result; if (toHydrogenToggle.isOn) { result = new PlayerData.AtomCollisionResult(); result.atomsProduced = new List <AtomAmo>(); result.atomsUsed = new List <AtomAmo>(); AtomAmo atomAmo = new AtomAmo(); PlayerData.AtomCollisionResult resultTemp; Atom atom = atomA; int amo = (int)atomAAmo.value; do { atomAmo.atom = atom; atomAmo.amo = amo; result.atomsUsed.Add(atomAmo); resultTemp = Game.Instance.playerData.ProduceSplit(atom, amo); atom = resultTemp.atomsProduced[0].atom; amo = resultTemp.atomsProduced[0].amo; } while (atom.GetAtomicNumber() != 1); result.atomsProduced.Add(resultTemp.atomsProduced[0]); } else { result = Game.Instance.playerData.ProduceSplit(atomA, (int)atomAAmo.value); } // Display Popup resultUI.Setup(result.atomsProduced, result.atomsUsed); Reset(); for (int i = 0; i < result.atomsProduced.Count; i++) { print("Atoms Produced: " + result.atomsProduced[i].atom.GetName() + " " + result.atomsProduced[i].amo); } }
public void Upgrade() { List <AtomAmo> oldUsedAtoms = new List <AtomAmo>(); List <AtomAmo> temp = Game.Instance.playerData.GetCost(currUpgradeType); for (int i = 0; i < temp.Count; i++) { oldUsedAtoms.Add(temp[i]); } bool success = Game.Instance.playerData.Upgrade(currUpgradeType); if (success) { resultUI.Setup(null, oldUsedAtoms); } var type = currUpgradeType; Reset(); SetUpgradeInfo(type); }