Add the ability to ask questions ABOUT the guards

This commit is contained in:
WillJeynes
2026-08-25 14:57:05 +01:00
parent 514ba1f26f
commit cf651447d3
18 changed files with 769 additions and 29 deletions
+12 -4
View File
@@ -7,10 +7,6 @@
{
"type": "DEFAULT",
"action": "LIFE"
},
{
"type": "DEFAULT",
"action": "DEATH"
}
],
"guards": [
@@ -23,11 +19,23 @@
"action": "TRUTHER"
}
],
"guardsmods": [
"HAT",
"SHORT"
],
"doorsmods": [
"BLUE",
"RED"
],
"dialog": {
"is": {
"DOORS": {
"safe": "DS#safe",
"unsafe": "DS#safe!"
},
"GUARDS_YOU": {
"short": "GS#short",
"wearing a hat": "GS#hat"
}
},
"NOREC_what would": {
+137
View File
@@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BlueMaterial
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 0.076129556, b: 1, a: 1}
- _Color: {r: 0, g: 0.07612953, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &1170845547364832982
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d62ae3e529a14d961b7ac9b6967da04e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
+4
View File
@@ -125,3 +125,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3194c39c08057cd4badc5a1721e6a498, type: 3}
m_Name:
m_EditorClassIdentifier: '::'
type:
mod:
blueMaterial: {fileID: 2100000, guid: d62ae3e529a14d961b7ac9b6967da04e, type: 2}
redMaterial: {fileID: 2100000, guid: 7a46060c77bcaaf79a5c30c1f6001499, type: 2}
+114
View File
@@ -0,0 +1,114 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6200270703225525303
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 523456750918914492}
- component: {fileID: 3856222877878501805}
- component: {fileID: 2341464222282115151}
- component: {fileID: 7100697606801959055}
m_Layer: 0
m_Name: GuardHat
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &523456750918914492
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6200270703225525303}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.02, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3856222877878501805
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6200270703225525303}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2341464222282115151
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6200270703225525303}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!135 &7100697606801959055
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6200270703225525303}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cee82d5174017241c83d924312623806
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+3
View File
@@ -125,3 +125,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 20061c4fba047435b84052ea7566f8cf, type: 3}
m_Name:
m_EditorClassIdentifier: '::'
type:
mod:
hat: {fileID: 6200270703225525303, guid: cee82d5174017241c83d924312623806, type: 3}
+137
View File
@@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8466448373200206863
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RedMaterial
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 1}
- _Color: {r: 1, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7a46060c77bcaaf79a5c30c1f6001499
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
+2 -1
View File
@@ -1021,7 +1021,7 @@ Transform:
m_GameObject: {fileID: 330585543}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5, y: 7.54, z: -35.5}
m_LocalPosition: {x: 24.86, y: 8.18, z: -49.7}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -2928,6 +2928,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::SpeechManager
charactersPerSecond: 10
Status: TALKING
--- !u!1 &1010843661
GameObject:
m_ObjectHideFlags: 0
+35 -13
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using DefaultNamespace;
using JetBrains.Annotations;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering;
@@ -85,16 +86,29 @@ public class DialogManager : Singleton<DialogManager>
//special keywords
if (kvp.Key == "DOORS")
{
for (int i = 0; i < LevelLoader.Instance.Doors.Count; i++)
foreach (var man in LevelLoader.Instance.Doors)
{
PopulateSingleQuestionOption(new KeyValuePair<string, JToken>("door " + (i+1), kvp.Value));
PopulateSingleQuestionOption(new KeyValuePair<string, JToken>(man.GetUnknownDescription(), kvp.Value));
}
}
else if (kvp.Key == "GUARDS")
else if (kvp.Key.StartsWith("GUARDS"))
{
for (int i = 0; i < LevelLoader.Instance.Guards.Count; i++)
foreach (var man in LevelLoader.Instance.Guards)
{
PopulateSingleQuestionOption(new KeyValuePair<string, JToken>("guard " + (i+1), kvp.Value));
string postfix = "";
if (man == currentGuard)
{
if (kvp.Key.EndsWith("YOU"))
{
postfix = " (you)";
}
else
{
//this lowkey breaks most puzzes cause double negative makes all tell truth
continue;
}
}
PopulateSingleQuestionOption(new KeyValuePair<string, JToken>(man.GetUnknownDescription() + postfix, kvp.Value));
}
}
else if (kvp.Key == "QUESTION")
@@ -178,7 +192,7 @@ public class DialogManager : Singleton<DialogManager>
FullQuestion = FullQuestionPrefixes.Pop() + FullQuestion;
}
Debug.LogError(FullQuestion);
Debug.Log(FullQuestion);
string q = "";
string r = "";
@@ -189,22 +203,30 @@ public class DialogManager : Singleton<DialogManager>
q += item;
r = item + " " + r;
if (item.StartsWith("guard "))
int ig = LevelLoader.Instance.Guards.FindIndex(
guard => item.StartsWith(guard.GetUnknownDescription())
);
if (ig >= 0)
{
FullQuestion = FullQuestion.ReplaceLast("GS", "G" + (int.Parse(item[^1].ToString())-1));
FullQuestion = FullQuestion.ReplaceLast("GS", "G" + ig);
}
if (item.StartsWith("door "))
int id = LevelLoader.Instance.Doors.FindIndex(
door => item.StartsWith(door.GetUnknownDescription())
);
if (id >= 0)
{
FullQuestion = FullQuestion.ReplaceLast("DS", "D" + (int.Parse(item[^1].ToString())-1));
FullQuestion = FullQuestion.ReplaceLast("DS", "D" + id);
}
}
Debug.LogError(q);
Debug.LogError(FullQuestion);
Debug.Log(FullQuestion);
//now get a response from the guard being questioned
var response = currentGuard.Answer(FullQuestion);
Debug.Log(response);
r = r.Replace("NOREC_", "");
+23 -1
View File
@@ -1,3 +1,4 @@
using System;
using DefaultNamespace;
using UnityEditor;
using UnityEngine;
@@ -6,10 +7,22 @@ using Utils;
public class DoorManager : MonoBehaviour, IDescribable
{
public string type;
public string mod;
public Material blueMaterial;
public Material redMaterial;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
if (mod == "BLUE")
{
this.GetComponent<Renderer>().material = blueMaterial;
}
else if (mod == "RED")
{
this.GetComponent<Renderer>().material = redMaterial;
}
}
// Update is called once per frame
@@ -64,4 +77,13 @@ public class DoorManager : MonoBehaviour, IDescribable
{
return "Describe " + type;
}
public string GetUnknownDescription()
{
if (mod == "RED" || mod == "BLUE")
{
return $"the {mod} door";
} // add more modification here
throw new NotImplementedException();
}
}
+59 -3
View File
@@ -7,10 +7,21 @@ using Utils;
public class GuardManager : MonoBehaviour, IDescribable
{
public string type;
public string mod;
public GameObject hat;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
if (mod == "SHORT")
{
transform.localScale = new Vector3(1f, 0.1f, 1f);
}
else if (mod == "HAT")
{
Instantiate(hat, transform);
}
}
// Update is called once per frame
@@ -64,8 +75,6 @@ public class GuardManager : MonoBehaviour, IDescribable
{
if (question[0] == 'G')
{
Debug.Log(question);
Debug.Log(question.Substring(1,1));
int index = int.Parse(question.Substring(1,1));
var guard = LevelLoader.Instance.Guards[index];
return guard.Answer(question.Substring(3));
@@ -84,6 +93,12 @@ public class GuardManager : MonoBehaviour, IDescribable
var door = LevelLoader.Instance.Doors[index];
return door.GetProperty(question.Substring(3));
}
else if (question[0] == 'G')
{
int index = int.Parse(question.Substring(1,1));
var guard = LevelLoader.Instance.Guards[index];
return guard.GetProperty(question.Substring(3));
}
else
{
throw new NotImplementedException();
@@ -104,4 +119,45 @@ public class GuardManager : MonoBehaviour, IDescribable
{
return "Describe " + type;
}
public string GetUnknownDescription()
{
if (mod == "SHORT")
{
return "the short guard";
}
else if (mod == "HAT")
{
return "the guard with the hat";
}// add more modification here
throw new NotImplementedException();
}
public QuestionAnswer GetProperty(string property)
{
var answer = QuestionAnswer.NO_YES;
if (property.StartsWith("hat"))
{
answer = mod == "HAT" ? QuestionAnswer.YES : QuestionAnswer.NO;
}
if (property.StartsWith("short"))
{
answer = mod == "SHORT" ? QuestionAnswer.YES : QuestionAnswer.NO;
}
if (property.EndsWith("!"))
{
//we want opposite, so switch
return answer switch
{
QuestionAnswer.YES => QuestionAnswer.NO,
QuestionAnswer.NO => QuestionAnswer.YES,
QuestionAnswer.NO_YES => QuestionAnswer.NO_YES // i think? since we cannot confidently lie?
};
}
//else return base
return answer;
}
}
+2
View File
@@ -40,6 +40,7 @@ public class LevelLoader : Singleton<LevelLoader>
var manager = doorinstance.GetComponent<DoorManager>();
manager.type = data.doors[i].action;
manager.mod = data.doorsmods.GetRandomAndRemove();
Doors.Add(manager);
}
@@ -53,6 +54,7 @@ public class LevelLoader : Singleton<LevelLoader>
var manager = guardinstance.GetComponent<GuardManager>();
manager.type = data.guards[i].action;
manager.mod = data.guardsmods.GetRandomAndRemove();
Guards.Add(manager);
}
+2
View File
@@ -39,7 +39,9 @@ public class SpeechManager : Singleton<SpeechManager>
{
StopCoroutine(ccoroutine);
mainText.text = fulltext;
Status = fulltext.Length > 30 ? "DONELONG" : "DONE";
fulltext = null;
}
else if (textBuffer.Count > 0)
{
+2
View File
@@ -7,6 +7,8 @@ namespace Utils
{
public List<DoorData> doors;
public List<GuardData> guards;
public List<string> guardsmods;
public List<string> doorsmods;
}
[System.Serializable]
+13
View File
@@ -14,5 +14,18 @@ namespace Utils
(list[i], list[j]) = (list[j], list[i]);
}
}
public static T GetRandomAndRemove<T>(this List<T> list)
{
if (list.Count == 0)
return default;
int index = Random.Range(0, list.Count);
T item = list[index];
list.RemoveAt(index);
return item;
}
}
}
+201 -7
View File
@@ -13,7 +13,50 @@ AnimationClip:
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_EulerCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.5
value: {x: 0, y: 0, z: 0.69970113}
inSlope: {x: 0, y: 0, z: 1.243913}
outSlope: {x: 0, y: 0, z: 1.243913}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.6333333
value: {x: 0, y: 0, z: 0.79}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
@@ -21,11 +64,15 @@ AnimationClip:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: 2800000, guid: 39f0fcaa7e44c19e4a8b30c3ecab6284, type: 3}
- time: 0.25
value: {fileID: 2800000, guid: 8798094872394245e922a6a5542513d0, type: 3}
- time: 0.25
value: {fileID: 2800000, guid: 39f0fcaa7e44c19e4a8b30c3ecab6284, type: 3}
- time: 0.5
value: {fileID: 2800000, guid: 8798094872394245e922a6a5542513d0, type: 3}
- time: 0.76666665
value: {fileID: 2800000, guid: 39f0fcaa7e44c19e4a8b30c3ecab6284, type: 3}
- time: 1
value: {fileID: 2800000, guid: 8798094872394245e922a6a5542513d0, type: 3}
attribute: m_Texture
path:
classID: 114
@@ -38,6 +85,16 @@ AnimationClip:
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
metaData: 0
- serializedVersion: 2
path: 0
attribute: 395606183
@@ -49,15 +106,17 @@ AnimationClip:
isSerializeReferenceCurve: 0
metaData: 0
pptrCurveMapping:
- {fileID: 2800000, guid: 8798094872394245e922a6a5542513d0, type: 3}
- {fileID: 2800000, guid: 39f0fcaa7e44c19e4a8b30c3ecab6284, type: 3}
- {fileID: 2800000, guid: 8798094872394245e922a6a5542513d0, type: 3}
- {fileID: 2800000, guid: 39f0fcaa7e44c19e4a8b30c3ecab6284, type: 3}
- {fileID: 2800000, guid: 8798094872394245e922a6a5542513d0, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.51666665
m_StopTime: 1.0166667
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
@@ -72,8 +131,143 @@ AnimationClip:
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_EditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path:
classID: 224
script: {fileID: 0}
flags: 16
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path:
classID: 224
script: {fileID: 0}
flags: 16
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6333333
value: 0.79
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path:
classID: 224
script: {fileID: 0}
flags: 16
m_EulerEditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path:
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path:
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path:
classID: 224
script: {fileID: 0}
flags: 0
m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []