mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-18 13:58:28 +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 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue