using System; using System.Collections.Generic; using UnityEngine; [CreateAssetMenu( fileName = "ItemPipeConfig", menuName = "Fort Bo/Pipe Junk/Item Pipe Config")] public sealed class ItemPipeConfig : ScriptableObject { [Serializable] public sealed class GuaranteedItem { public GameObject prefab; [Min(1)] public int amount = 1; } [Serializable] public sealed class RandomItem { public GameObject prefab; [Min(0f)] public float weight = 1f; } [Header("Timing")] [SerializeField, Min(0.05f)] private float spawnInterval = 0.5f; [SerializeField, Min(0f)] private float spawnCooldown = 10f; [Header("Instant velocity change")] [SerializeField] private Vector3 localVelocityChange = Vector3.forward * 4.5f; [Header("Guaranteed items")] [SerializeField] private List guaranteedItems = new(); [Header("Random items")] [SerializeField, Min(0)] private int randomItemCount = 5; [SerializeField] private List randomItems = new(); [Header("Spawn position randomization")] [SerializeField, Min(0f)] private float randomSpawnX = 0.2f; [SerializeField, Min(0f)] private float randomSpawnZ = 0.2f; public float SpawnInterval => spawnInterval; public float SpawnCooldown => spawnCooldown; public Vector3 LocalVelocityChange => localVelocityChange; public IReadOnlyList GuaranteedItems => guaranteedItems; public int RandomItemCount => randomItemCount; public IReadOnlyList RandomItems => randomItems; public float RandomSpawnX => randomSpawnX; public float RandomSpawnZ => randomSpawnZ; }