using System; using Sirenix.OdinInspector; using Systems; using UnityEngine; namespace Settings { [CreateAssetMenu(menuName = "Application/Game Configuration")] public class GameConfiguration : ScriptableObject { [SerializeField] private DifficultyStage boostStage; [SerializeField] private DifficultyStage[] stages; public DifficultyStage GetStage(int inIndex) { if (inIndex >= stages.Length) throw new Exception("Difficulty index out of bounds!"); return stages[inIndex]; } public bool IsLastStage(int inIndex) => inIndex >= stages.Length; public DifficultyStage GetBoostStage() => boostStage; public DifficultyStage GetLastStage() => stages[^1]; [Button] private void FixTempObstacles() { foreach (var spawn in boostStage.objectsToSpawn) { if (spawn.objectType != ObjectList.Obstacle) continue; if (spawn.minLanes == 5) spawn.minLanes = 4; if (spawn.maxLanes == 5) spawn.maxLanes = 4; } foreach (var stage in stages) { foreach (var spawn in stage.objectsToSpawn) { if (spawn.objectType != ObjectList.Obstacle) continue; if (spawn.minLanes == 5) spawn.minLanes = 4; if (spawn.maxLanes == 5) spawn.maxLanes = 4; } } Debug.Log("Fix Complete"); } } }