Files
modular-vr/Assets/Engine/Runtime/EngineTheme.cs
2023-05-12 02:59:40 +02:00

57 lines
1.8 KiB
C#

using System.Collections.Generic;
using EscapeRoomEngine.Engine.Runtime.Modules.Description;
using EscapeRoomEngine.Engine.Runtime.Utilities;
using JetBrains.Annotations;
using NaughtyAttributes;
using UnityEngine;
namespace EscapeRoomEngine.Engine.Runtime
{
/// <summary>
/// An engine theme decides the room size, look and available modules for the engine.
/// </summary>
[CreateAssetMenu(menuName = "Engine Theme")]
public class EngineTheme : ScriptableObject
{
#region Theme
[BoxGroup("Theme")] [Required]
[Tooltip("The tile that rooms are generated from.")]
public SpaceTile spaceTile;
[BoxGroup("Theme")]
[Tooltip("The environment that is placed around every generated room.")]
public GameObject environment;
[BoxGroup("Theme")]
public DynamicColor puzzleColor, solvedColor, activeColor;
#endregion
#region Doors
[BoxGroup("Doors")] [Required]
public DoorModuleDescription spawnDoor;
[BoxGroup("Doors")] [ValidateInput("IsNotEmpty", "At least one exit door type is required.")]
[Tooltip("The types of exit doors this theme provides. Entrance doors are connected to the exit doors and don't need to be specified here.")]
public List<DoorModuleDescription> exitDoorTypes;
#endregion
#region Puzzles
[BoxGroup("Puzzles")] [MinMaxSlider(0, 24)]
public Vector2Int puzzleCount;
[BoxGroup("Puzzles")]
public List<PuzzleModuleDescription> puzzleTypes;
public PuzzleModuleDescription GetPuzzle(int id) => puzzleTypes.Find(puzzle => puzzle.Id == id);
#endregion
[UsedImplicitly]
private bool IsNotEmpty(List<DoorModuleDescription> modules) => modules.Count > 0;
}
}