Beispiel #1
0
 private void UpdatePlayerProperties()
 {
     if (scoreValue % scoreAmountToAddRed == 0)
     {
         playerControl.RedSqureAdd();
     }
     if (scoreValue % scoreAmountToAddBlue == 0)
     {
         playerControl.BlueSqureAdd();
     }
 }
Beispiel #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Bonus")
     {
         if (player.level < 5)
         {
             player.level++;
         }
         Destroy(other.gameObject);
         GetComponent <AudioSource>().Play();
     }
     else if (other.tag == "Blue")
     {
         player.BlueSqureAdd();
         Destroy(other.gameObject);
         GetComponent <AudioSource>().Play();
     }
     else if (other.tag == "Red")
     {
         player.RedSqureAdd();
         Destroy(other.gameObject);
         GetComponent <AudioSource>().Play();
     }
 }