33 lines
850 B
C#
33 lines
850 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace EscapeRoomEngine.Engine.Runtime.Modules
|
|
{
|
|
public class PuzzleModule : Module
|
|
{
|
|
internal PuzzleState PuzzleState
|
|
{
|
|
get
|
|
{
|
|
if (State is PuzzleState puzzleState)
|
|
{
|
|
return puzzleState;
|
|
}
|
|
|
|
throw new Exception("PuzzleModule must contain a PuzzleState");
|
|
}
|
|
}
|
|
|
|
internal PuzzleModule(Space space, PuzzleModuleDescription description) : base(space, description)
|
|
{
|
|
srDimensions.Size = Vector2Int.one; // TODO: larger modules
|
|
}
|
|
|
|
internal override void InstantiateModule(Transform parent)
|
|
{
|
|
base.InstantiateModule(parent);
|
|
|
|
space.room.AddPuzzle(this);
|
|
}
|
|
}
|
|
} |