Files
2024-11-19 11:48:21 +01:00

35 lines
788 B
C#

using UnityEngine;
namespace Gley.TrafficSystem
{
/// <summary>
/// Stores the vehicle prefabs used in scene
/// </summary>
[CreateAssetMenu(fileName = "VehiclePool", menuName = "TrafficSystem/Vehicle Pool", order = 1)]
public class VehiclePool : ScriptableObject
{
public CarType[] trafficCars;
public VehiclePool()
{
CarType carType = new CarType();
trafficCars = new CarType[] { carType };
}
}
[System.Serializable]
public class CarType
{
public GameObject vehiclePrefab;
[Range(1, 100)]
public int percent;
public bool dontInstantiate;
public CarType()
{
percent = 1;
}
}
}