46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Minigames.Airplane.Data
|
|
{
|
|
/// <summary>
|
|
/// Configuration for a single spawn pool.
|
|
/// Contains prefabs, unlock timing, and optional spawn parameter overrides.
|
|
/// </summary>
|
|
[Serializable]
|
|
public class SpawnPoolConfig
|
|
{
|
|
[Tooltip("Prefabs that can spawn from this pool")]
|
|
public GameObject[] prefabs;
|
|
|
|
[Tooltip("Time (seconds from game start) when this pool becomes available. 0 = available immediately.")]
|
|
public float unlockTime = 0f;
|
|
|
|
[Tooltip("Description for this pool (editor reference only)")]
|
|
public string description = "Pool";
|
|
|
|
[Header("Spawn Parameter Overrides (0 = use global)")]
|
|
[Tooltip("Override minimum spawn distance for this pool (0 = use global)")]
|
|
public float overrideMinDistance = 0f;
|
|
|
|
[Tooltip("Override maximum spawn distance for this pool (0 = use global)")]
|
|
public float overrideMaxDistance = 0f;
|
|
|
|
/// <summary>
|
|
/// Check if this pool has valid prefabs assigned.
|
|
/// </summary>
|
|
public bool HasPrefabs => prefabs != null && prefabs.Length > 0;
|
|
|
|
/// <summary>
|
|
/// Get effective minimum distance (uses override if non-zero, otherwise uses global).
|
|
/// </summary>
|
|
public float GetMinDistance(float globalMin) => overrideMinDistance > 0f ? overrideMinDistance : globalMin;
|
|
|
|
/// <summary>
|
|
/// Get effective maximum distance (uses override if non-zero, otherwise uses global).
|
|
/// </summary>
|
|
public float GetMaxDistance(float globalMax) => overrideMaxDistance > 0f ? overrideMaxDistance : globalMax;
|
|
}
|
|
}
|
|
|