puzzle module framework, puzzle a ball module
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Modules
|
||||
{
|
||||
public class PuzzleModule : Module
|
||||
{
|
||||
internal new PuzzleState State { get; private set; }
|
||||
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)
|
||||
{
|
||||
@@ -17,11 +29,5 @@ namespace Escape_Room_Engine.Engine.Scripts.Modules
|
||||
|
||||
space.room.AddPuzzle(this);
|
||||
}
|
||||
|
||||
protected override void AddStateComponent()
|
||||
{
|
||||
State = moduleObject.AddComponent<PuzzleState>();
|
||||
State.SetModule(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user