Dossier complet
This commit is contained in:
19
Droid 2/Assets/Black Hole.cs
Normal file
19
Droid 2/Assets/Black Hole.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class BlackHole : MonoBehaviour
|
||||
{
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
// Vérifie si le droïde ou tout autre objet entre dans le trou noir
|
||||
if (other.gameObject.CompareTag("Player"))
|
||||
{
|
||||
Debug.Log("Droid destroyed by Black Hole!");
|
||||
Destroy(other.gameObject); // Détruit le droïde
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"{other.gameObject.name} destroyed by Black Hole!");
|
||||
Destroy(other.gameObject); // Détruit tout autre objet
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user