refactor: LevelDefinition ScriptableObject drives floor count and geometry
This commit is contained in:
39
Assets/Scripts/Infrastructure/Unity/LevelDefinition.cs
Normal file
39
Assets/Scripts/Infrastructure/Unity/LevelDefinition.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Infrastructure.Unity
|
||||
{
|
||||
[CreateAssetMenu(fileName = "LevelDefinition", menuName = "Decay Grid/Level Definition")]
|
||||
public class LevelDefinition : ScriptableObject
|
||||
{
|
||||
[SerializeField] private int gridSizeX = 10;
|
||||
[SerializeField] private int gridSizeY = 10;
|
||||
[SerializeField] private float floorHeightDistance = 15f;
|
||||
[SerializeField] private FloorConfig[] floors =
|
||||
{
|
||||
new() { pattern = FloorPatternType.Square },
|
||||
new() { pattern = FloorPatternType.Donut },
|
||||
new() { pattern = FloorPatternType.Circle }
|
||||
};
|
||||
|
||||
public int GridSizeX => gridSizeX;
|
||||
public int GridSizeY => gridSizeY;
|
||||
public float FloorHeightDistance => floorHeightDistance;
|
||||
public int FloorCount => floors.Length;
|
||||
public IReadOnlyList<FloorConfig> Floors => floors;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class FloorConfig
|
||||
{
|
||||
public FloorPatternType pattern;
|
||||
}
|
||||
|
||||
public enum FloorPatternType
|
||||
{
|
||||
Square,
|
||||
Donut,
|
||||
Circle
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user