puzzle module framework, puzzle a ball module

This commit is contained in:
2022-11-18 02:10:05 +01:00
parent bd0934636f
commit 99e0452379
90 changed files with 4799 additions and 51 deletions

View File

@@ -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);
}
}
}