"Destroy all vehicles" button now explodes the vehicles, instead of destroying them

This commit is contained in:
in0finite 2020-06-20 16:18:09 +02:00
parent 41856f3def
commit bd37b9f577

View file

@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using SanAndreasUnity.Behaviours; using SanAndreasUnity.Behaviours;
using System.Linq;
namespace SanAndreasUnity.UI { namespace SanAndreasUnity.UI {
@ -81,10 +82,10 @@ namespace SanAndreasUnity.UI {
if (GUILayout.Button("Destroy all vehicles")) if (GUILayout.Button("Destroy all vehicles"))
{ {
var vehicles = FindObjectsOfType<Behaviours.Vehicles.Vehicle> (); var vehicles = Behaviours.Vehicles.Vehicle.AllVehicles.ToArray();
foreach (var v in vehicles) { foreach (var v in vehicles) {
Destroy (v.gameObject); v.Explode();
} }
} }