void Update() { if (Input.GetKeyDown(KeyCode.M)) { InventoryPersist.setMoney(InventoryPersist.getMoney() + 100); } }
public void endRace(bool didWin) { string winText = !didWin ? "You lose!" : "You win!\n\nPrize Money: $" + reward; winScreen.GetComponentInChildren <Text>().text = winText; winScreen.SetActive(true); state = states.END; timer = 5; foreach (GameObject glider in gliders) { glider.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezePosition; } if (didWin) { InventoryPersist.setMoney(InventoryPersist.getMoney() + reward); SoundManager.Instance().StopBGM(); SoundManager.Instance().PlayAnySFX(SoundManager.SFXv2.Victory); } else { SoundManager.Instance().StopBGM(); SoundManager.Instance().PlayAnySFX(SoundManager.SFXv2.Loss); } }
public void SetTextColorOnAffordability() { if (!item.CanAfford(InventoryPersist.getMoney())) { itemCostText.color = Color.red; } else { itemCostText.color = Color.red; } }
void consumeFood(Interaction.Food foodItem) { //TODO support for different levels of food quality //TODO GUI for stats SoundManager.Instance().PlayAnySFX(SoundManager.SFXv2.Food); StartCoroutine(size.increase(1 + .5f * InventoryPersist.getFeederLevel())); Destroy(foodItem.gameObject); }
public void endRace() { winScreen.enabled = true; state = states.END; timer = 5; foreach (GameObject glider in gliders) { glider.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezePosition; } InventoryPersist.setMoney(InventoryPersist.getMoney() + reward); }
public void BuySelectedItem() { //Pay(selectedItem); if (selectedItem.CanAfford(InventoryPersist.getMoney())) { //play "purchase made" sound InventoryPersist.setMoney(InventoryPersist.getMoney() - selectedItem.cost); selectedItem.UseItem(); } else { // play "purchase failed" sound, if wanted } }
public void BuySelectedItem() { //Pay(selectedItem); if (selectedItem.CanAfford(InventoryPersist.getMoney())) { // TODO play "purchase made" sound InventoryPersist.setMoney(InventoryPersist.getMoney() - selectedItem.cost); selectedItem.UseItem(); Debug.Log("Buy/use item"); SetFundsText(); CreateItemList(); SetCanBuyEachItem(); } else { // TODO play "purchase failed" sound, if wanted Debug.Log("Can't afford!"); } }
void Update() { Hen under = findHenUnder(); bool henFound = false; if (under != null) { henFound = true; if (brushProgress == 0 || lastHen.GetInstanceID() != under.GetInstanceID()) { StopHenFlap(lastHen); lastHen = under; brushProgress = maxBrushTimer; MakeHenFlap(lastHen); SoundManager.Instance().PlayAnySFX(SoundManager.SFXv2.Brush); } } if (!henFound && checkHenStillBeingPetTimer < 0) { StopHenFlap(lastHen); brushProgress = 0; } if (checkHenStillBeingPetTimer < 0) { checkHenStillBeingPetTimer = 0.5f; } checkHenStillBeingPetTimer -= Time.deltaTime; if (brushProgress > 0) { brushProgress -= Time.deltaTime; if (brushProgress <= 0) { StartCoroutine(lastHen.love.increase(1 + .5f * InventoryPersist.getPettingLevel())); brushProgress = 0; } } else { brushProgress = 0; } }
public override bool CanBeBought() { return(InventoryPersist.getBathLevel() + 1 == level); }
int GetPlayerMoney() { return(InventoryPersist.getMoney()); }
public void RaiseLevel() { InventoryPersist.setPettingLevel(InventoryPersist.getPettingLevel() + 1); SetMaterial(InventoryPersist.getPettingLevel()); }
void Start() { SetMaterial(InventoryPersist.getTreadmillLevel()); }
public void RaiseLevel() { InventoryPersist.setTreadmillLevel(InventoryPersist.getTreadmillLevel() + 1); SetMaterial(InventoryPersist.getTreadmillLevel()); }
void Start() { SetMaterial(InventoryPersist.getFeederLevel()); }
public void RaiseLevel() { InventoryPersist.setFeederLevel(InventoryPersist.getFeederLevel() + 1); SetMaterial(InventoryPersist.getFeederLevel()); }
public void finishBath(Bath bath) { StartCoroutine(featherQuality.increase(1 + .5f * InventoryPersist.getBathLevel())); bath.unFill(); }
public void finishExercise(Treadmill treadmill) { StartCoroutine(fitness.increase(1 + .5f * InventoryPersist.getTreadmillLevel())); }
void Start() { SetMaterial(InventoryPersist.getBathLevel()); }