Ejemplo n.º 1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.M))
     {
         InventoryPersist.setMoney(InventoryPersist.getMoney() + 100);
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public void SetTextColorOnAffordability()
 {
     if (!item.CanAfford(InventoryPersist.getMoney())) {
         itemCostText.color = Color.red;
     } else {
         itemCostText.color = Color.red;
     }
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
    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
        }
    }
Ejemplo n.º 7
0
    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!");
        }
    }
Ejemplo n.º 8
0
        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;
            }
        }
Ejemplo n.º 9
0
 public override bool CanBeBought()
 {
     return(InventoryPersist.getBathLevel() + 1 == level);
 }
Ejemplo n.º 10
0
 int GetPlayerMoney()
 {
     return(InventoryPersist.getMoney());
 }
Ejemplo n.º 11
0
 public void RaiseLevel()
 {
     InventoryPersist.setPettingLevel(InventoryPersist.getPettingLevel() + 1);
     SetMaterial(InventoryPersist.getPettingLevel());
 }
Ejemplo n.º 12
0
 void Start()
 {
     SetMaterial(InventoryPersist.getTreadmillLevel());
 }
Ejemplo n.º 13
0
 public void RaiseLevel()
 {
     InventoryPersist.setTreadmillLevel(InventoryPersist.getTreadmillLevel() + 1);
     SetMaterial(InventoryPersist.getTreadmillLevel());
 }
Ejemplo n.º 14
0
 void Start()
 {
     SetMaterial(InventoryPersist.getFeederLevel());
 }
Ejemplo n.º 15
0
 public void RaiseLevel()
 {
     InventoryPersist.setFeederLevel(InventoryPersist.getFeederLevel() + 1);
     SetMaterial(InventoryPersist.getFeederLevel());
 }
Ejemplo n.º 16
0
 public void finishBath(Bath bath)
 {
     StartCoroutine(featherQuality.increase(1 + .5f * InventoryPersist.getBathLevel()));
     bath.unFill();
 }
Ejemplo n.º 17
0
 public void finishExercise(Treadmill treadmill)
 {
     StartCoroutine(fitness.increase(1 + .5f * InventoryPersist.getTreadmillLevel()));
 }
Ejemplo n.º 18
0
 void Start()
 {
     SetMaterial(InventoryPersist.getBathLevel());
 }