mirror of
https://github.com/ConjureETS/Labo_2_equ_2_a15.git
synced 2026-03-24 09:31:07 +00:00
on peut prendre une bombe et la lancer mais elle ne tue pas l'ennemi la caisse de vie peut être prise mais ne soigne pas
28 lines
397 B
C#
28 lines
397 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class BombPickup : MonoBehaviour
|
|
{
|
|
|
|
|
|
void Awake()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
void OnTriggerEnter2D (Collider2D other)
|
|
{
|
|
// If the player enters the trigger zone...
|
|
if(other.tag == "Player")
|
|
{
|
|
// Increase the number of bombs the player has.
|
|
other.GetComponent<LayBombs>().bombCount++;
|
|
|
|
// Destroy the crate.
|
|
Destroy(gameObject);
|
|
}
|
|
|
|
}
|
|
}
|