end terminal placement

This commit is contained in:
2023-05-15 20:52:27 +02:00
parent bbdae70907
commit 16a69d2fec
12 changed files with 76 additions and 13 deletions

View File

@@ -189,8 +189,14 @@ namespace EscapeRoomEngine.Engine.Runtime
private void GenerateEndSpace(Room room, Passage entrance)
{
Logger.Log($"Generating end space...", LogType.RoomGeneration);
room.AddSpace(new Space(room, entrance), null);
var space = new Space(room, entrance);
var endModule = new Module(space, theme.endModule);
if (!space.AddModuleWithRequirements(endModule))
{
throw new EngineException("Could not satisfy requirements for end module.");
}
room.AddSpace(space, null);
}
#endregion

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using EscapeRoomEngine.Engine.Runtime.Environment;
using EscapeRoomEngine.Engine.Runtime.Modules.Description;
using EscapeRoomEngine.Engine.Runtime.Modules.State;
using EscapeRoomEngine.Engine.Runtime.Utilities;
using JetBrains.Annotations;
using NaughtyAttributes;
@@ -19,6 +20,9 @@ namespace EscapeRoomEngine.Engine.Runtime
[BoxGroup("Theme")]
public Intro intro;
[BoxGroup("Theme")]
public ModuleDescription endModule;
[BoxGroup("Theme")] [Required]
[Tooltip("The tile that rooms are generated from.")]
public SpaceTile spaceTile;

View File

@@ -18,6 +18,7 @@ namespace EscapeRoomEngine.Engine.Runtime.Measurements
/// </summary>
public static bool Store { get; set; }
public static bool PreferLessPlayed => GameControl.Instance.preferLessPlayed.Value;
public static int PuzzlesSolved => _currentSession.PuzzlesSolved.Count;
private static Dictionary<int, PuzzleMeasurement> _runningMeasurements;
private static Session _currentSession;

View File

@@ -1479,6 +1479,7 @@ Transform:
- {fileID: 675198211105780961}
- {fileID: 538618498}
- {fileID: 9336441}
- {fileID: 1976313343}
m_Father: {fileID: 1340421038}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -3265,7 +3266,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1976313343}
- {fileID: 411421604}
m_Father: {fileID: 0}
m_RootOrder: 4
@@ -5100,7 +5100,7 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1340421038}
m_TransformParent: {fileID: 411421604}
m_Modifications:
- target: {fileID: 3117311599528751296, guid: fc5ba6ab25589494f9757b42379c2c14,
type: 3}

View File

@@ -5119,7 +5119,7 @@ ParticleSystem:
startSize:
serializedVersion: 2
minMaxState: 0
scalar: 0.01
scalar: 0.02
minScalar: 0.001
maxCurve:
serializedVersion: 2
@@ -9896,7 +9896,7 @@ ParticleSystem:
startSize:
serializedVersion: 2
minMaxState: 0
scalar: 0.003
scalar: 0.006
minScalar: 1
maxCurve:
serializedVersion: 2

View File

@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: abf4a405f6c64073995bded39977563e, type: 3}
m_Name: M End Terminal
m_EditorClassIdentifier:
types: 03000000
modulePrefab: {fileID: 6668481611205895174, guid: fc5ba6ab25589494f9757b42379c2c14,
type: 3}
preconditionRequirements: []
placementRequirements:
- {fileID: 11400000, guid: 43eb2a566a244964aa3a3319eaafe1a8, type: 2}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dbd778c370ce9b14aab18ab343fb99df
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -758,7 +758,7 @@ ParticleSystem:
startSize:
serializedVersion: 2
minMaxState: 0
scalar: 0.01
scalar: 0.02
minScalar: 0.001
maxCurve:
serializedVersion: 2
@@ -10952,7 +10952,7 @@ ParticleSystem:
startSize:
serializedVersion: 2
minMaxState: 0
scalar: 0.003
scalar: 0.006
minScalar: 1
maxCurve:
serializedVersion: 2
@@ -16154,7 +16154,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: '5 Beacons
m_text: '5 beacons
successfully
@@ -16165,7 +16165,7 @@ MonoBehaviour:
Thank you
thank you
for
playing'

View File

@@ -125,8 +125,8 @@ Material:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0, g: 4.329412, b: 8, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _NoiseSpeed: {r: -0.1, g: 0, b: 0, a: 0}
- _ScrollingSpeed: {r: 0.01, g: 0, b: 0, a: 0}
- _NoiseSpeed: {r: 0.1, g: 0, b: 0, a: 0}
- _ScrollingSpeed: {r: -0.01, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &4030118509478967149

View File

@@ -1,4 +1,7 @@
using EscapeRoomEngine.Engine.Runtime.Modules;
using System;
using EscapeRoomEngine.Engine.Runtime;
using EscapeRoomEngine.Engine.Runtime.Measurements;
using EscapeRoomEngine.Engine.Runtime.Modules;
using EscapeRoomEngine.Engine.Runtime.Modules.State;
using EscapeRoomEngine.VR.Runtime;
using NaughtyAttributes;
@@ -12,6 +15,23 @@ namespace Station46.Modules.End_Terminal.Scripts
[BoxGroup("Internal")] [SerializeField] private TMP_Text text;
[BoxGroup("Internal")] [SerializeField] private Transform rotation;
public int BeaconsActivated
{
set
{
var currentText = text.text;
currentText = value == 1
? currentText.Replace("beacons", "beacon")
: currentText.Replace("beacon", "beacons");
text.text = value + currentText[currentText.IndexOf(' ')..];
}
}
private void Start()
{
BeaconsActivated = Measure.PuzzlesSolved;
}
private void Update()
{
var lookAt =

View File

@@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: Station 46
m_EditorClassIdentifier:
intro: {fileID: 6790828229373266063, guid: 1358b4ef564c4704682417dff526766a, type: 3}
endModule: {fileID: 11400000, guid: dbd778c370ce9b14aab18ab343fb99df, type: 2}
spaceTile: {fileID: 3229991053255736984, guid: b8f192f7cebe686468af6b1a71c4605b,
type: 3}
environments:

View File

@@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: Test Theme
m_EditorClassIdentifier:
intro: {fileID: 6790828229373266063, guid: 1358b4ef564c4704682417dff526766a, type: 3}
endModule: {fileID: 11400000, guid: dbd778c370ce9b14aab18ab343fb99df, type: 2}
spaceTile: {fileID: 3229991053255736984, guid: b8f192f7cebe686468af6b1a71c4605b,
type: 3}
environments:
@@ -33,3 +34,5 @@ MonoBehaviour:
puzzleCount: {x: 1, y: 1}
puzzleTypes:
- {fileID: 11400000, guid: 1b21332d2a4da2d4d9f8a105d1e24980, type: 2}
- {fileID: 11400000, guid: ee5a44432e80cd64689be3ff34750339, type: 2}
- {fileID: 11400000, guid: 010a967ecaf566041a0e12459806bd04, type: 2}