void PickupSpeed2(Collider2D player2)
    {
        Movement_2 move2 = player2.GetComponent <Movement_2>();

        if (move2.PlayerSpeed < 1)
        {
            move2.PlayerSpeed *= 1.5f;
        }
        Destroy(gameObject);
    }
Beispiel #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Player1" && BombOnOff == true)
     {
         Movement_1 bombnumber = collision.GetComponent <Movement_1>();
         bombnumber.MaxBomCount++;
         Destroy(gameObject);
     }
     else if (collision.gameObject.tag == "Player2" && BombOnOff == true)
     {
         Movement_2 Bombnumber = collision.GetComponent <Movement_2>();
         Bombnumber.MaxBombNum++;
         Destroy(gameObject);
     }
 }