mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-27 06:20:17 +00:00
"Destroy all vehicles" button now explodes the vehicles, instead of destroying them
This commit is contained in:
parent
41856f3def
commit
bd37b9f577
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using SanAndreasUnity.Behaviours;
|
||||
using System.Linq;
|
||||
|
||||
namespace SanAndreasUnity.UI {
|
||||
|
||||
|
@ -81,10 +82,10 @@ namespace SanAndreasUnity.UI {
|
|||
|
||||
if (GUILayout.Button("Destroy all vehicles"))
|
||||
{
|
||||
var vehicles = FindObjectsOfType<Behaviours.Vehicles.Vehicle> ();
|
||||
var vehicles = Behaviours.Vehicles.Vehicle.AllVehicles.ToArray();
|
||||
|
||||
foreach (var v in vehicles) {
|
||||
Destroy (v.gameObject);
|
||||
v.Explode();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue