store session to db only after ended, allow test runs without writing to db

This commit is contained in:
2022-12-14 17:21:24 +01:00
parent db5123278d
commit 8565ae77cd
5 changed files with 650 additions and 34 deletions

View File

@@ -45,8 +45,122 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 20, y: -10}
m_SizeDelta: {x: 200, y: 200}
m_SizeDelta: {x: 110, y: 200}
m_Pivot: {x: 0, y: 1}
--- !u!1 &3745094239397758703
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4828107142513213589}
- component: {fileID: 7349628183060000906}
- component: {fileID: 4483254339768210730}
m_Layer: 5
m_Name: Checkmark
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4828107142513213589
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3745094239397758703}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7240461740690111740}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7349628183060000906
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3745094239397758703}
m_CullTransparentMesh: 1
--- !u!114 &4483254339768210730
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3745094239397758703}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3905085823373151408
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9062548758054197003}
m_Layer: 5
m_Name: Measurement Control
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &9062548758054197003
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3905085823373151408}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2787558276881847208}
- {fileID: 3462504880841960080}
m_Father: {fileID: 4522052738963994966}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -20, y: -10}
m_SizeDelta: {x: 110, y: 200}
m_Pivot: {x: 1, y: 1}
--- !u!1 &4522052738963994969
GameObject:
m_ObjectHideFlags: 0
@@ -80,6 +194,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7182894751559651105}
- {fileID: 9062548758054197003}
- {fileID: 482424009816971294}
m_Father: {fileID: 0}
m_RootOrder: 0
@@ -172,6 +287,312 @@ MonoBehaviour:
targetTimeText: {fileID: 7086005505455629096}
estimateTimeText: {fileID: 5237193151499999206}
gameState: 0
--- !u!1 &5267753817356931382
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7240461740690111740}
- component: {fileID: 8086160962991272604}
- component: {fileID: 986396680377347035}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7240461740690111740
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5267753817356931382}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4828107142513213589}
m_Father: {fileID: 3462504880841960080}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -3}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0, y: 1}
--- !u!222 &8086160962991272604
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5267753817356931382}
m_CullTransparentMesh: 1
--- !u!114 &986396680377347035
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5267753817356931382}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5644458805796663834
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3462504880841960080}
- component: {fileID: 7511283043026536990}
m_Layer: 5
m_Name: Store Measurements
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3462504880841960080
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5644458805796663834}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7240461740690111740}
- {fileID: 463847630703981816}
m_Father: {fileID: 9062548758054197003}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -34}
m_SizeDelta: {x: 110, y: 30}
m_Pivot: {x: 0, y: 1}
--- !u!114 &7511283043026536990
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5644458805796663834}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 986396680377347035}
toggleTransition: 1
graphic: {fileID: 4483254339768210730}
m_Group: {fileID: 0}
onValueChanged:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 6342815206448132038}
m_TargetAssemblyTypeName: EscapeRoomEngine.Engine.Runtime.UI.GameControl,
Engine
m_MethodName: StoreMeasurements
m_Mode: 2
m_Arguments:
m_ObjectArgument: {fileID: 7511283043026536990}
m_ObjectArgumentAssemblyTypeName: UnityEngine.UI.Toggle, UnityEngine.UI
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_IsOn: 1
--- !u!1001 &177056593356364422
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 9062548758054197003}
m_Modifications:
- target: {fileID: 2655555272253868329, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_Name
value: Title
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_RootOrder
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_SizeDelta.x
value: 110
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_SizeDelta.y
value: 30
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -4
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868335, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_Text
value: Measurements
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fa44f6047bc35a141a84d1b4e0919ff9, type: 3}
--- !u!224 &2787558276881847208 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
m_PrefabInstance: {fileID: 177056593356364422}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &596244725760480134
PrefabInstance:
m_ObjectHideFlags: 0
@@ -201,6 +622,16 @@ PrefabInstance:
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
propertyPath: m_AnchorMin.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
propertyPath: m_LocalPosition.x
@@ -214,7 +645,7 @@ PrefabInstance:
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 80
value: -30
objectReference: {fileID: 0}
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
@@ -613,7 +1044,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
@@ -623,7 +1054,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
@@ -678,7 +1109,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 64
value: -46
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
@@ -864,6 +1295,140 @@ RectTransform:
type: 3}
m_PrefabInstance: {fileID: 1881346252679449620}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2501054174014209494
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 3462504880841960080}
m_Modifications:
- target: {fileID: 2655555272253868329, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_Name
value: Label
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_RootOrder
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_SizeDelta.x
value: 80
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_SizeDelta.y
value: 30
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 30
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868335, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_Text
value: Store
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fa44f6047bc35a141a84d1b4e0919ff9, type: 3}
--- !u!224 &463847630703981816 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
m_PrefabInstance: {fileID: 2501054174014209494}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3709675561396504867
PrefabInstance:
m_ObjectHideFlags: 0
@@ -1255,7 +1820,7 @@ PrefabInstance:
- target: {fileID: 3635623840709501521, guid: c7b840466ebfae1468d75282ab9334f5,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3635623840709501521, guid: c7b840466ebfae1468d75282ab9334f5,
type: 3}
@@ -1265,7 +1830,7 @@ PrefabInstance:
- target: {fileID: 3635623840709501521, guid: c7b840466ebfae1468d75282ab9334f5,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3635623840709501521, guid: c7b840466ebfae1468d75282ab9334f5,
type: 3}
@@ -1320,7 +1885,7 @@ PrefabInstance:
- target: {fileID: 3635623840709501521, guid: c7b840466ebfae1468d75282ab9334f5,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 60
value: -50
objectReference: {fileID: 0}
- target: {fileID: 3635623840709501521, guid: c7b840466ebfae1468d75282ab9334f5,
type: 3}
@@ -1436,7 +2001,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
@@ -1446,7 +2011,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
@@ -1501,7 +2066,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 64
value: -46
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
@@ -1587,6 +2152,16 @@ PrefabInstance:
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
propertyPath: m_LocalPosition.x
@@ -1600,7 +2175,7 @@ PrefabInstance:
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 40
value: -15
objectReference: {fileID: 0}
- target: {fileID: 5840570772713645737, guid: a0d402627dc805e42ab9e84487b9871b,
type: 3}
@@ -1845,7 +2420,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
@@ -1855,7 +2430,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
@@ -1910,7 +2485,7 @@ PrefabInstance:
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 64
value: -46
objectReference: {fileID: 0}
- target: {fileID: 2655555272253868334, guid: fa44f6047bc35a141a84d1b4e0919ff9,
type: 3}

View File

@@ -35,7 +35,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 4, y: -4}
m_AnchoredPosition: {x: 0, y: -4}
m_SizeDelta: {x: 43.5, y: 30}
m_Pivot: {x: 0, y: 1}
--- !u!222 &2655555272253868332

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using EscapeRoomEngine.Engine.Runtime.Modules;
using EscapeRoomEngine.Engine.Runtime.Utilities;
using UnityEngine;
using Logger = EscapeRoomEngine.Engine.Runtime.Utilities.Logger;
using LogType = EscapeRoomEngine.Engine.Runtime.Utilities.LogType;
@@ -8,7 +9,13 @@ namespace EscapeRoomEngine.Engine.Runtime.Measurements
{
public static class Measure
{
/// <summary>
/// Whether to store the taken measurements in the database. Disable for test runs.
/// </summary>
public static bool Store { get; set; }
private static Dictionary<int, PuzzleMeasurement> _runningMeasurements;
private static Session _currentSession;
public static void StartMeasuring(PuzzleModuleDescription puzzle)
{
@@ -23,22 +30,43 @@ namespace EscapeRoomEngine.Engine.Runtime.Measurements
public static void Solve(PuzzleModuleDescription puzzle)
{
var measurement = _runningMeasurements[puzzle.Id];
if (_currentSession == null)
{
throw new EngineException("Measuring session must be started before taking measurements.");
}
PuzzleStorage.Instance.EndMeasurement(puzzle, measurement);
var measurement = _runningMeasurements[puzzle.Id];
if (Store)
{
PuzzleStorage.Instance.EndMeasurement(_currentSession, puzzle, measurement);
}
_runningMeasurements.Remove(puzzle.Id);
Logger.Log($"Solved {puzzle} with measurement {measurement}", LogType.Measuring);
}
public static void StartSession() => PuzzleStorage.Instance.StartSession();
public static void StartSession()
{
_currentSession = new Session();
Logger.Log($"Started {_currentSession}", LogType.Measuring);
}
public static void EndSession(float time)
{
PuzzleStorage.Instance.EndSession(time);
if (Store)
{
PuzzleStorage.Instance.EndSession(_currentSession, time);
}
Logger.Log(PuzzleStorage.Instance.Session.ToString(), LogType.Measuring);
Logger.Log($"Ended {_currentSession}", LogType.Measuring);
}
public static void Clear() => _runningMeasurements = new Dictionary<int, PuzzleMeasurement>();
public static void Clear()
{
_runningMeasurements = new Dictionary<int, PuzzleMeasurement>();
Store = true;
}
}
}

View File

@@ -24,8 +24,6 @@ namespace EscapeRoomEngine.Engine.Runtime.Measurements
[SerializeField]
private string databasePath = "measurements.realm";
public Session Session { get; private set; }
private Realm _realm;
private void OnEnable()
@@ -45,15 +43,21 @@ namespace EscapeRoomEngine.Engine.Runtime.Measurements
#region Session
public void StartSession() => _realm.Write(() => Session = _realm.Add(new Session()));
public void EndSession(float time) =>_realm.Write(() => Session.Time = time);
public void EndSession(Session session, float time)
{
session.Time = time;
_realm.Write(() =>
{
_realm.Add(session);
});
}
#endregion
#region Puzzles
public Puzzle New(PuzzleModuleDescription puzzle)
private Puzzle New(PuzzleModuleDescription puzzle)
{
Puzzle created = null;
@@ -61,10 +65,10 @@ namespace EscapeRoomEngine.Engine.Runtime.Measurements
return created;
}
public Puzzle LoadOrNew(PuzzleModuleDescription puzzle) => _realm.Find<Puzzle>(puzzle.Id) ?? New(puzzle);
public Puzzle Load(PuzzleModuleDescription puzzle) => _realm.Find<Puzzle>(puzzle.Id);
private Puzzle LoadOrNew(PuzzleModuleDescription puzzle) => _realm.Find<Puzzle>(puzzle.Id) ?? New(puzzle);
private Puzzle Load(PuzzleModuleDescription puzzle) => _realm.Find<Puzzle>(puzzle.Id);
public void Delete(PuzzleModuleDescription puzzle)
{
@@ -75,7 +79,7 @@ namespace EscapeRoomEngine.Engine.Runtime.Measurements
}
}
public void EndMeasurement(PuzzleModuleDescription puzzle, PuzzleMeasurement measurement)
public void EndMeasurement(Session session, PuzzleModuleDescription puzzle, PuzzleMeasurement measurement)
{
var found = LoadOrNew(puzzle);
@@ -85,7 +89,7 @@ namespace EscapeRoomEngine.Engine.Runtime.Measurements
found.Measurements.Add(measurement);
// add solved puzzle to session
Session.PuzzlesSolved.Add(found);
session.PuzzlesSolved.Add(found);
});
}

View File

@@ -129,6 +129,15 @@ namespace EscapeRoomEngine.Engine.Runtime.UI
#endregion
#region Measurements
public void StoreMeasurements(Toggle toggle)
{
Measure.Store = toggle.isOn;
}
#endregion
public void ExitGame()
{
StopGame();