Example #1
0
    public void NoInk(bool b)
    {
        bool lifeLeft = grm.EarnOrSpendLife(-1);

        if (lifeLeft == false)
        {
            //player has no lives left -> game over
            return;
        }

        drawLine.enabled = false;
        DestroyEnemies();

        panel.gameObject.SetActive(true);
        panel.ShowNoInk();
    }
Example #2
0
 public void GetHurt(int damage)
 {
     if (immuneTimes > 0)
     {
         AudioManager.Play("Protect");
         isHurt = true;
         immuneTimes--;
         anim.SetBool("isProtected", true);
         Debug.Log("Protected!");
     }
     else
     {
         AudioManager.Play("Hurt");
         OnHurt(true);
         isHurt = true;
         anim.SetBool("isHurt", true);
         grm.EarnOrSpendLife(damage);
     }
 }
    void ReceiveProduct()
    {
        if (product.rCoin)
        {
            grm.EarnOrSpendCoin(product.receiveAmount);
        }
        else if (product.rCheese)
        {
            grm.EarnOrSpendCheese(product.receiveAmount);
        }
        else if (product.rLife)
        {
            grm.EarnOrSpendLife(product.receiveAmount);
        }
        else //increase equipment slot
        {
            IncreaseEquipmentSlot();
        }

        messagePanel.ThankYou();
    }