Exemplo n.º 1
0
 private void handleTrashCan(Collider other)
 {
     if (other.tag == "Trashcan" && Input.GetKeyDown(KeyCode.E))
     {
         shopSystem.SetMoneyAmount(plasticValue * _currentPickUpAmount);
         _currentPickUpAmount = 0;
     }
 }
Exemplo n.º 2
0
 private void handleTrashCan(Collider other)
 {
     if (other.tag == "Trashcan" && Input.GetKeyDown(KeyCode.E))
     {
         float amountEarned = plasticValue * _currentPickUpAmount;
         shopSystem.SetMoneyAmount(amountEarned);
         shopSystem.SetTotalEarned(amountEarned);
         FindObjectOfType <AudioManager>().Play("ThrowTrash");
         _currentPickUpAmount = 0;
     }
 }
Exemplo n.º 3
0
    private void attack()
    {
        Collider[] hitEnemies = Physics.OverlapSphere(AttackPoint.position, AttackRange, EnemyLayers);
        Collider[] hitGoodGuy = Physics.OverlapSphere(AttackPoint.position, AttackRange, GoodGuyLayers);

        foreach (Collider enemy in hitEnemies)
        {
            shopSystem.SetMoneyAmount(6f);
            FindObjectOfType <AudioManager>().Play("Slap");
            enemy.GetComponent <Enemy>().SetIsDead();
        }
        foreach (Collider GoodGuy in hitGoodGuy)
        {
            FindObjectOfType <AudioManager>().Play("Slap");
            GoodGuy.GetComponent <GoodGuy>().WrongHit();
        }
    }
Exemplo n.º 4
0
 public void WrongHit()
 {
     anim.SetBool("IsSlapped", true);
     shopSystem.SetMoneyAmount(-5f);
 }