Compare commits

..

No commits in common. "2670a870be4921bc5d3a72e26054da4390c055d8" and "e402e01ec482d8ad8eb1f9002d44e369061e9ff7" have entirely different histories.

10 changed files with 547 additions and 238 deletions

View File

@ -191,6 +191,78 @@ MonoBehaviour:
m_Spacing: {x: 50, y: 50} m_Spacing: {x: 50, y: 50}
m_Constraint: 0 m_Constraint: 0
m_ConstraintCount: 2 m_ConstraintCount: 2
--- !u!1 &9253746
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9253747}
- component: {fileID: 9253749}
- component: {fileID: 9253748}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &9253747
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9253746}
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: 581333954}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &9253748
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9253746}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 2800000, guid: 51cab6d235722024da1a1ba85f4d2e99, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &9253749
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9253746}
m_CullTransparentMesh: 1
--- !u!1 &45150984 --- !u!1 &45150984
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -219,6 +291,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 500028487}
- {fileID: 619055281} - {fileID: 619055281}
- {fileID: 1798182258} - {fileID: 1798182258}
- {fileID: 1350310808} - {fileID: 1350310808}
@ -647,10 +720,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2430977146559507814, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_fontSize
value: 36
objectReference: {fileID: 0}
- target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} - target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerSticker (5) value: PlayerSticker (5)
@ -1420,10 +1489,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2430977146559507814, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_fontSize
value: 36
objectReference: {fileID: 0}
- target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} - target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerSticker (4) value: PlayerSticker (4)
@ -1748,10 +1813,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2430977146559507814, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_fontSize
value: 36
objectReference: {fileID: 0}
- target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} - target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerSticker (1) value: PlayerSticker (1)
@ -2049,6 +2110,78 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 411140634} m_GameObject: {fileID: 411140634}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &427170778
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 427170779}
- component: {fileID: 427170781}
- component: {fileID: 427170780}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &427170779
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 427170778}
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: 1117928115}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &427170780
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 427170778}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 2800000, guid: 51cab6d235722024da1a1ba85f4d2e99, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &427170781
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 427170778}
m_CullTransparentMesh: 1
--- !u!1 &440351810 --- !u!1 &440351810
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2185,6 +2318,78 @@ MonoBehaviour:
m_Spacing: {x: 150, y: 100} m_Spacing: {x: 150, y: 100}
m_Constraint: 0 m_Constraint: 0
m_ConstraintCount: 2 m_ConstraintCount: 2
--- !u!1 &500028486
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 500028487}
- component: {fileID: 500028489}
- component: {fileID: 500028488}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &500028487
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 500028486}
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: 45150985}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &500028488
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 500028486}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 2800000, guid: 51cab6d235722024da1a1ba85f4d2e99, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &500028489
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 500028486}
m_CullTransparentMesh: 1
--- !u!1 &516717322 --- !u!1 &516717322
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2290,6 +2495,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 9253747}
- {fileID: 190388869} - {fileID: 190388869}
- {fileID: 1813019851} - {fileID: 1813019851}
- {fileID: 98075281} - {fileID: 98075281}
@ -2573,7 +2779,6 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 1836364712}
- {fileID: 1117928115} - {fileID: 1117928115}
- {fileID: 45150985} - {fileID: 45150985}
- {fileID: 1730465903} - {fileID: 1730465903}
@ -2809,10 +3014,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2430977146559507814, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_fontSize
value: 36
objectReference: {fileID: 0}
- target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} - target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerSticker value: PlayerSticker
@ -3060,10 +3261,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2430977146559507814, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_fontSize
value: 36
objectReference: {fileID: 0}
- target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} - target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerSticker (7) value: PlayerSticker (7)
@ -3990,10 +4187,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2430977146559507814, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_fontSize
value: 36
objectReference: {fileID: 0}
- target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} - target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerSticker (6) value: PlayerSticker (6)
@ -4333,10 +4526,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2430977146559507814, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_fontSize
value: 36
objectReference: {fileID: 0}
- target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} - target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerSticker (3) value: PlayerSticker (3)
@ -4825,6 +5014,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 427170779}
- {fileID: 2078353088} - {fileID: 2078353088}
- {fileID: 1901141295} - {fileID: 1901141295}
- {fileID: 1499472362} - {fileID: 1499472362}
@ -6986,6 +7176,81 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1503133438} m_GameObject: {fileID: 1503133438}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1542177989
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1542177990}
- component: {fileID: 1542177992}
- component: {fileID: 1542177991}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1542177990
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1542177989}
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: 1660260834}
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: -756, y: 200.00002}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1542177991
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1542177989}
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: 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!222 &1542177992
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1542177989}
m_CullTransparentMesh: 1
--- !u!1 &1567271221 --- !u!1 &1567271221
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -7372,6 +7637,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 1542177990}
- {fileID: 1850877722}
- {fileID: 1351333135} - {fileID: 1351333135}
- {fileID: 1236996027} - {fileID: 1236996027}
- {fileID: 1567271222} - {fileID: 1567271222}
@ -7710,6 +7977,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 1803918110}
- {fileID: 1165659435} - {fileID: 1165659435}
- {fileID: 987875882} - {fileID: 987875882}
- {fileID: 157938956} - {fileID: 157938956}
@ -8117,6 +8385,78 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1798182257} m_GameObject: {fileID: 1798182257}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1803918109
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1803918110}
- component: {fileID: 1803918112}
- component: {fileID: 1803918111}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1803918110
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1803918109}
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: 1730465903}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1803918111
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1803918109}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 2800000, guid: 51cab6d235722024da1a1ba85f4d2e99, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &1803918112
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1803918109}
m_CullTransparentMesh: 1
--- !u!1 &1805240025 --- !u!1 &1805240025
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -8326,7 +8666,7 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1813019850} m_GameObject: {fileID: 1813019850}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1836364711 --- !u!1 &1850877721
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
@ -8334,9 +8674,9 @@ GameObject:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 1836364712} - component: {fileID: 1850877722}
- component: {fileID: 1836364714} - component: {fileID: 1850877724}
- component: {fileID: 1836364713} - component: {fileID: 1850877723}
m_Layer: 5 m_Layer: 5
m_Name: Background m_Name: Background
m_TagString: Untagged m_TagString: Untagged
@ -8344,35 +8684,35 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!224 &1836364712 --- !u!224 &1850877722
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1836364711} m_GameObject: {fileID: 1850877721}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 610087870} m_Father: {fileID: 1660260834}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0.000030517578, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 1920, y: 1080}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1836364713 --- !u!114 &1850877723
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1836364711} m_GameObject: {fileID: 1850877721}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
@ -8383,23 +8723,20 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_Sprite: {fileID: 21300000, guid: 51cab6d235722024da1a1ba85f4d2e99, type: 3} m_Texture: {fileID: 2800000, guid: 51cab6d235722024da1a1ba85f4d2e99, type: 3}
m_Type: 0 m_UVRect:
m_PreserveAspect: 0 serializedVersion: 2
m_FillCenter: 1 x: 0
m_FillMethod: 4 y: 0
m_FillAmount: 1 width: 1
m_FillClockwise: 1 height: 1
m_FillOrigin: 0 --- !u!222 &1850877724
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1836364714
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1836364711} m_GameObject: {fileID: 1850877721}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1854893634 --- !u!1 &1854893634
GameObject: GameObject:
@ -8877,10 +9214,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2430977146559507814, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_fontSize
value: 36
objectReference: {fileID: 0}
- target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3} - target: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerSticker (2) value: PlayerSticker (2)

View File

@ -49,7 +49,6 @@ public void WebcamResume()
wTexture.Play(); wTexture.Play();
photo = null; photo = null;
photoBox.texture = null;
freezeButton.gameObject.SetActive(true); freezeButton.gameObject.SetActive(true);
resumeButton.gameObject.SetActive(false); resumeButton.gameObject.SetActive(false);
} }

View File

@ -28,20 +28,6 @@ public Room(string _code)
currentState = 1; //default by PC currentState = 1; //default by PC
} }
public Room Copy()
{
Room newRoom = new Room(this.code)
{
questions = new Dictionary<int, Question>(this.questions),
players = new Dictionary<string, Player>(this.players),
currentQuestionId = this.currentQuestionId,
creationDate = this.creationDate,
currentState = this.currentState
};
return newRoom;
}
/// <summary> /// <summary>
/// Return the only player with a specific ID /// Return the only player with a specific ID
/// </summary> /// </summary>

View File

@ -20,6 +20,7 @@ public class GameManager : MonoBehaviour
[Header("Other component")] [Header("Other component")]
public float explanationTime = 4f; public float explanationTime = 4f;
private float currentExplanationTime = 0;
[Header("Home Connection Component")] [Header("Home Connection Component")]
public TMP_InputField roomCodeField; public TMP_InputField roomCodeField;
@ -64,11 +65,7 @@ private void Awake()
private void Start() private void Start()
{ {
InitializeHomePage(); currentExplanationTime = explanationTime;
}
private void InitializeHomePage()
{
HomeConnection.SetActive(true); HomeConnection.SetActive(true);
WaitingRoom.SetActive(false); WaitingRoom.SetActive(false);
BeforeStart.SetActive(false); BeforeStart.SetActive(false);
@ -76,11 +73,10 @@ private void InitializeHomePage()
VotePicture.SetActive(false); VotePicture.SetActive(false);
WaitingOtherPlayers.SetActive(false); WaitingOtherPlayers.SetActive(false);
EndGame.SetActive(false); EndGame.SetActive(false);
submitStartGame.SetActive(false);
submitNewPlayer.interactable = true;
if (PlayerPrefs.HasKey("lastplayername")) if (PlayerPrefs.HasKey("lastplayername"))
playerNameField.text = PlayerPrefs.GetString("lastplayername"); playerNameField.text = PlayerPrefs.GetString("lastplayername");
} }
private void OnApplicationQuit() private void OnApplicationQuit()
@ -289,15 +285,17 @@ public void StartGame()
/// </summary> /// </summary>
private void OnRoomUpdate(object sender, ValueChangedEventArgs e) private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
{ {
Debug.Log("begin OnRoomUpdate");
GameState lastState = (GameState)myRoom.currentState; GameState lastState = (GameState)myRoom.currentState;
try try
{ {
if (e?.Snapshot?.GetRawJsonValue() != null) if (e?.Snapshot?.GetRawJsonValue() != null)
{ {
string JSON = e.Snapshot.GetRawJsonValue(); string JSON = e.Snapshot.GetRawJsonValue();
Debug.Log($"Room has been updated : {JSON}", this);
myRoom = JsonConvert.DeserializeObject<Room>(e.Snapshot.GetRawJsonValue()); myRoom = JsonConvert.DeserializeObject<Room>(e.Snapshot.GetRawJsonValue());
} }
} }
catch (Exception ex) catch (Exception ex)
@ -306,11 +304,10 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
} }
if (myRoom == null) if (myRoom == null)
{ {
Debug.LogError("Got an update for an empty room.", this); Debug.Log("myroom is null");
return; return;
} }
Debug.Log($"lasState = {lastState}. Currentstep = {(GameState)myRoom.currentState}", this);
if (myRoom.currentState != (int)lastState) if (myRoom.currentState != (int)lastState)
{ {
OnNewGameState(); OnNewGameState();
@ -344,66 +341,61 @@ private void OnNewGameState()
{ {
case (int)GameState.EnteringName: case (int)GameState.EnteringName:
{ {
InitializeHomePage(); if (EndGame.activeInHierarchy)
{
EndGame.SetActive(false);
HomeConnection.SetActive(true);
}
break; break;
} }
case (int)GameState.Explanation: case (int)GameState.Explanation:
{ {
Debug.Log("Explanation time.", this); if (EndGame.activeInHierarchy)
{
WaitingOtherPlayers.SetActive(false);
TakePicture.SetActive(false);
WaitingRoom.SetActive(false);
VotePicture.SetActive(false);
EndGame.SetActive(false); EndGame.SetActive(false);
}
WaitingRoom.SetActive(false);
BeforeStart.SetActive(true); BeforeStart.SetActive(true);
endOfViewDate = DateTime.Now.AddSeconds(4); endOfViewDate = DateTime.Now.AddSeconds(4);
break; break;
} }
case (int)GameState.MakeProposition: case (int)GameState.MakeProposition:
{
if (BeforeStart.activeInHierarchy)
{ {
Debug.Log("It's photo time !", this); Debug.Log("It's photo time !", this);
WaitingOtherPlayers.SetActive(false);
BeforeStart.SetActive(false); BeforeStart.SetActive(false);
WaitingRoom.SetActive(false);
VotePicture.SetActive(false);
EndGame.SetActive(false);
TakePicture.SetActive(true); TakePicture.SetActive(true);
endOfViewDate = DateTime.Now.AddSeconds(60); endOfViewDate = DateTime.Now.AddSeconds(60);
}
break; break;
} }
case (int)GameState.MakeVote: case (int)GameState.MakeVote:
{
if (TakePicture.activeInHierarchy || WaitingOtherPlayers.activeInHierarchy)
{ {
Debug.Log("It's voting time !", this); Debug.Log("It's voting time !", this);
WaitingOtherPlayers.SetActive(false); WaitingOtherPlayers.SetActive(false);
BeforeStart.SetActive(false);
WaitingRoom.SetActive(false);
TakePicture.SetActive(false); TakePicture.SetActive(false);
EndGame.SetActive(false);
VotePicture.SetActive(true); VotePicture.SetActive(true);
Debug.Log("subscribe to question ID");
myOnlineRoom.Child("currentQuestionId").ValueChanged += OnCurrentQuestionChanged; myOnlineRoom.Child("currentQuestionId").ValueChanged += OnCurrentQuestionChanged;
}
break; break;
} }
case (int)GameState.Score: case (int)GameState.Score:
{
if (VotePicture.activeInHierarchy || WaitingOtherPlayers.activeInHierarchy)
{ {
Debug.Log("it's scoring time !", this); Debug.Log("it's scoring time !", this);
Debug.Log("unsubscribe to question ID");
myOnlineRoom.Child("currentQuestionId").ValueChanged -= OnCurrentQuestionChanged; myOnlineRoom.Child("currentQuestionId").ValueChanged -= OnCurrentQuestionChanged;
WaitingOtherPlayers.SetActive(false);
BeforeStart.SetActive(false);
WaitingRoom.SetActive(false);
TakePicture.SetActive(false);
VotePicture.SetActive(false); VotePicture.SetActive(false);
WaitingOtherPlayers.SetActive(false);
EndGame.SetActive(true);
endGameFirstPlayer.SetActive(CheckIfIAmTheFirst(myRoom.GetPlayerList())); endGameFirstPlayer.SetActive(CheckIfIAmTheFirst(myRoom.GetPlayerList()));
endGameOtherPlayers.SetActive(!CheckIfIAmTheFirst(myRoom.GetPlayerList())); endGameOtherPlayers.SetActive(!CheckIfIAmTheFirst(myRoom.GetPlayerList()));
EndGame.SetActive(true);
}
break; break;
} }
@ -476,18 +468,15 @@ public void OnClickSubmitSignIn()
{ {
string playerName = playerNameField.text; string playerName = playerNameField.text;
string roomCode = roomCodeField.text; string roomCode = roomCodeField.text;
submitNewPlayer.interactable = false;
PlayerValidateNameAndServerRoom(playerName, roomCode); PlayerValidateNameAndServerRoom(playerName, roomCode);
} }
public void onClickSamePlayers() public void onClickSamePlayers()
{ {
Debug.Log("Play with same players !", this); myRoom.currentState = (int)GameState.Explanation;
Room newRoom = myRoom.Copy(); myRoom.questions = null;
newRoom.currentState = (int)GameState.Explanation; myRoom.currentQuestionId = 0;
newRoom.questions.Clear(); string json = JsonConvert.SerializeObject(myRoom);
newRoom.currentQuestionId = 0;
string json = JsonConvert.SerializeObject(newRoom);
myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task => myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task =>
{ {
@ -500,13 +489,11 @@ public void onClickSamePlayers()
} }
public void onClickNewPlayers() public void onClickNewPlayers()
{ {
Debug.Log("Play with new players !", this); myRoom.currentState = (int)GameState.EnteringName;
Room newRoom = myRoom.Copy(); myRoom.currentQuestionId = 0;
newRoom.currentState = (int)GameState.EnteringName; myRoom.questions = null;
newRoom.currentQuestionId = 0; myRoom.players = null;
newRoom.questions = null; string json = JsonConvert.SerializeObject(myRoom);
newRoom.players = null;
string json = JsonConvert.SerializeObject(newRoom);
myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task => myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task =>
{ {
@ -520,9 +507,6 @@ public void onClickNewPlayers()
private void OnCurrentQuestionChanged(object sender, ValueChangedEventArgs onlineValue) private void OnCurrentQuestionChanged(object sender, ValueChangedEventArgs onlineValue)
{ {
if (onlineValue == null || onlineValue.Snapshot == null || onlineValue.Snapshot.Value == null || myRoom.questions == null || myRoom.questions.Count == 0)
return;
int questionId = onlineValue.Snapshot.Value.ConvertTo<int>(); int questionId = onlineValue.Snapshot.Value.ConvertTo<int>();
Debug.Log($"new question ! Q{(onlineValue.Snapshot.Value.ConvertTo<int>())}"); Debug.Log($"new question ! Q{(onlineValue.Snapshot.Value.ConvertTo<int>())}");

View File

@ -16,6 +16,7 @@ public class PropositionHandler : MonoBehaviour
public void ShowQuestion(Question currentQuestion) public void ShowQuestion(Question currentQuestion)
{ {
List<Proposition> props = currentQuestion.propositions.Values.ToList(); List<Proposition> props = currentQuestion.propositions.Values.ToList();
string enPrompt = prompts.GetPromptById(currentQuestion.promptId).en; string enPrompt = prompts.GetPromptById(currentQuestion.promptId).en;
promptLabel.text = enPrompt; promptLabel.text = enPrompt;
@ -23,12 +24,6 @@ public void ShowQuestion(Question currentQuestion)
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
int index = i; // Capture la valeur de i pour cette itération int index = i; // Capture la valeur de i pour cette itération
if(props[i].photoUrl == null)
{
Debug.Log("One player did not send a proposition !", this);
}
else
{
StorageManager.ConvertGoogleStorageURLToHttpsUrl(props[i].photoUrl, _httpURL => StorageManager.ConvertGoogleStorageURLToHttpsUrl(props[i].photoUrl, _httpURL =>
{ {
StartCoroutine(StorageManager.DownloadImage_Coroutine(_httpURL, (Texture texture) => StartCoroutine(StorageManager.DownloadImage_Coroutine(_httpURL, (Texture texture) =>
@ -38,7 +33,6 @@ public void ShowQuestion(Question currentQuestion)
})); }));
}); });
} }
}
} }

View File

@ -12,7 +12,7 @@ public class QuestionHandler : MonoBehaviour
public PromptList promptList; public PromptList promptList;
private GameManager gameManager; private GameManager gameManager;
private List<Question> questionsToAnswer = new List<Question>(); private List<Question> questionsToAnswer;
private int activeAnsweredQuestionIndex = 0; private int activeAnsweredQuestionIndex = 0;
private const int FirstQuestionIndex = 0; private const int FirstQuestionIndex = 0;
@ -25,14 +25,21 @@ public class QuestionHandler : MonoBehaviour
/// </summary> /// </summary>
void OnEnable() void OnEnable()
{ {
activeAnsweredQuestionIndex = FirstQuestionIndex;
submitButton.interactable = true;
submitButton.GetComponent<TextMeshProUGUI>().text = "Submit";
gameManager = managers.GetComponent<GameManager>(); gameManager = managers.GetComponent<GameManager>();
questionsToAnswer = gameManager.myRoom.GetQuestionsByPlayer(gameManager.currentPlayer); questionsToAnswer = gameManager.myRoom.GetQuestionsByPlayer(gameManager.currentPlayer);
Redraw(activeAnsweredQuestionIndex); Redraw(activeAnsweredQuestionIndex);
} }
/// <summary>
/// Called when the script is disabled.
/// Cleans up resources and resets the activeAnsweredQuestionIndex.
/// </summary>
void OnDisable()
{
questionsToAnswer = null;
activeAnsweredQuestionIndex = FirstQuestionIndex;
}
/// <summary> /// <summary>
/// Redraws the UI with the information from the current question. /// Redraws the UI with the information from the current question.
/// </summary> /// </summary>

View File

@ -6,9 +6,12 @@
using UnityEngine; using UnityEngine;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Linq; using System.Linq;
using Google.MiniJSON;
using Firebase.Storage; using Firebase.Storage;
using System.Security.Policy;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Collections; using System.Collections;
using System.Security.Cryptography;
public class RoomManager : MonoBehaviour public class RoomManager : MonoBehaviour
{ {
@ -53,17 +56,10 @@ private void Awake()
} }
private void Start() private void Start()
{
InitializeFirstPage();
}
private void InitializeFirstPage()
{ {
explanationPage.SetActive(false); explanationPage.SetActive(false);
waitForPropositionsPage.gameObject.SetActive(false); waitForPropositionsPage.gameObject.SetActive(false);
votingPage.gameObject.SetActive(false); votingPage.gameObject.SetActive(false);
scoringPage.gameObject.SetActive(false);
waitingForPlayersPage.SetActive(true); waitingForPlayersPage.SetActive(true);
ResetAllPlayerLabels(); ResetAllPlayerLabels();
} }
@ -105,43 +101,8 @@ private void ResetAllPlayerLabels()
private bool deleteRoomFilesCompleted = false; private bool deleteRoomFilesCompleted = false;
private bool deleteRealtimeDBCompleted = false; private bool deleteRealtimeDBCompleted = false;
private void OnApplicationQuit() private IEnumerator OnApplicationQuit()
{ {
StartCoroutine(Coroutine_ClearCurrentRoom(() =>
{
Debug.Log("You can go. Bye bye...");
}));
}
private void Initialize()
{
FirebaseInitializer.Instance.onFirebaseReady -= Initialize;
realtimeDB = FirebaseDatabase.DefaultInstance.RootReference;
Debug.Log("Realtime DB initialized");
ClearOldAndCreateNewRoom();
}
private void ClearOldAndCreateNewRoom()
{
CleanOldRooms();
StartCoroutine(Coroutine_ClearCurrentRoom(() =>
{
CreateNewRoom();
}));
}
private IEnumerator Coroutine_ClearCurrentRoom(Action callback_OnRoomClear = null)
{
if(myRoom == null || string.IsNullOrEmpty(myRoom.code))
{
yield return null;
Debug.Log("There is no last room to clean", this);
callback_OnRoomClear?.Invoke();
}
else
{
realtimeDB.Child("rooms").Child(myRoom.code).ValueChanged -= OnRoomUpdate;
Debug.Log($"delete files of room {myRoom.code} from storage", this); Debug.Log($"delete files of room {myRoom.code} from storage", this);
StorageManager.Instance.DeleteFileOfRoom(myRoom, () => StorageManager.Instance.DeleteFileOfRoom(myRoom, () =>
{ {
@ -161,15 +122,23 @@ private IEnumerator Coroutine_ClearCurrentRoom(Action callback_OnRoomClear = nul
{ {
yield return null; // Yield until both tasks are completed yield return null; // Yield until both tasks are completed
} }
callback_OnRoomClear?.Invoke();
Debug.Log("Everything is clean."); Debug.Log("Everything is clean. You can go. Bye bye...");
} }
private void Initialize()
{
FirebaseInitializer.Instance.onFirebaseReady -= Initialize;
realtimeDB = FirebaseDatabase.DefaultInstance.RootReference;
Debug.Log("Realtime DB initialized");
CleanOldRooms();
CreateNewRoom();
} }
/// <summary> /// <summary>
/// Check all the rooms in the server and give back the number already taken /// Check all the rooms in the server and give back the number already taken
/// </summary> /// </summary>
private void WhichCodesAreAlreadyUsed(Action<List<int>> callback_OnCodesChecked) private void WhichCodesAreAlreadyUsed(Action<List<int>> callback_OnCodesChecked)
{ {
QueryRoomsInDatabase(onlineRooms => QueryRoomsInDatabase(onlineRooms =>
@ -294,6 +263,8 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs value)
case (int)GameState.WaitingForOtherPlayersToJoin: case (int)GameState.WaitingForOtherPlayersToJoin:
UpdateConnectedPlayerList(myRoom.GetPlayerList()); UpdateConnectedPlayerList(myRoom.GetPlayerList());
break; break;
case (int)GameState.Explanation:
break;
case (int)GameState.MakeProposition: case (int)GameState.MakeProposition:
waitForPropositionsPage.OnRoomUpdate(myRoom); waitForPropositionsPage.OnRoomUpdate(myRoom);
break; break;
@ -311,18 +282,12 @@ private void OnNewGameStateStarted()
{ {
switch (myRoom.currentState) switch (myRoom.currentState)
{ {
case (int)GameState.EnteringName: //if game has been reset by a player on mobile
ClearOldAndCreateNewRoom();
InitializeFirstPage();
break;
case (int)GameState.WaitingForOtherPlayersToJoin: case (int)GameState.WaitingForOtherPlayersToJoin:
Debug.Log("New State : WaitingForOtherPlayersToJoin"); Debug.Log("New State : WaitingForOtherPlayersToJoin");
break; break;
case (int)GameState.Explanation: case (int)GameState.Explanation:
Debug.Log("New State : Explanation"); Debug.Log("New State : Explanation");
scoringPage.gameObject.SetActive(false); //if we come back from a new game
waitingForPlayersPage.SetActive(false); waitingForPlayersPage.SetActive(false);
explanationPage.SetActive(true); explanationPage.SetActive(true);
endOfExplanationDate = DateTime.Now.AddSeconds(explanationTime); endOfExplanationDate = DateTime.Now.AddSeconds(explanationTime);
@ -401,7 +366,7 @@ private void QueryRoomsInDatabase(Action<List<Room>> callback)
catch (Exception e) catch (Exception e)
{ {
Debug.LogException(e); Debug.LogException(e);
Debug.Log($"Room {JSON} is broken, deleting it", this); Debug.LogError($"Room {JSON} was broken, deleting it", this);
snapshot.Reference.RemoveValueAsync().ContinueWithOnMainThread(task => snapshot.Reference.RemoveValueAsync().ContinueWithOnMainThread(task =>
{ {
if (task.IsFaulted) if (task.IsFaulted)
@ -409,9 +374,8 @@ private void QueryRoomsInDatabase(Action<List<Room>> callback)
Debug.LogException(task.Exception); Debug.LogException(task.Exception);
return; return;
} }
Debug.Log($"Broken room has been deleted. Checking again", this); Debug.Log($"Broken room has been deleted", this);
QueryRoomsInDatabase(callback); }); ;
});
} }
} }
else else
@ -453,4 +417,25 @@ private void DeleteRoom(string _roomCode)
Debug.Log($"Room {_roomCode} has been deleted"); Debug.Log($"Room {_roomCode} has been deleted");
}); });
} }
private async Task<bool> DoesPathExistAsync(StorageReference storageReference)
{
try
{
await storageReference.GetMetadataAsync();
return true; // Path exists
}
catch (StorageException ex)
{
if (ex.ErrorCode == StorageException.ErrorObjectNotFound)
{
return false; // Path does not exist
}
else
{
Debug.LogException(ex);
return false; // Handle other errors as needed
}
}
}
} }

View File

@ -65,6 +65,7 @@ public void DeleteFileOfRoom(Room _room, Action callBack_OnFinish)
Debug.Log($"There is no files to delete for room {_room.code}", this); Debug.Log($"There is no files to delete for room {_room.code}", this);
callBack_OnFinish.Invoke(); callBack_OnFinish.Invoke();
} }
} }
private void RunDeleteTasks(List<Task> deleteTasks, Action callback_OnFinish) private void RunDeleteTasks(List<Task> deleteTasks, Action callback_OnFinish)
@ -79,6 +80,37 @@ private void RunDeleteTasks(List<Task> deleteTasks, Action callback_OnFinish)
}); });
} }
/*
private IEnumerator RunDeleteTasks(List<Task> deleteTasks, Action callback_OnFinish)
{
int taskCount = deleteTasks.Count;
Debug.Log($"There are {taskCount} files to delete", this);
foreach (Task task in deleteTasks)
{
task.ContinueWith((completedTask) =>
{
// This code will be executed when the task is completed.
taskCount--;
});
// Start the task
task.Start();
}
while (taskCount > 0)
{
yield return null;
}
callback_OnFinish?.Invoke();
}
private Task DeletePhoto(string _gsURL)
{
string temp = _gsURL;
StorageReference imageRef = FirebaseStorage.DefaultInstance.GetReferenceFromUrl(temp);
Debug.Log($"deleting {temp}", this);
return imageRef.DeleteAsync();
}*/
public void UploadPhoto(string roomCode, string playerId, int question, int proposition, Action<bool> callback_OnPhotoUploaded) public void UploadPhoto(string roomCode, string playerId, int question, int proposition, Action<bool> callback_OnPhotoUploaded)
{ {
Texture2D photo = cameraManager.GetPhoto(); Texture2D photo = cameraManager.GetPhoto();

View File

@ -94,13 +94,10 @@ private void EndCurrentQuestion()
public void ShowVotingPage(DatabaseReference _roomRef, Dictionary<string, Player> _currentPlayers, Dictionary<int, Question> _questions, Action _callback_OnVoteEnded) public void ShowVotingPage(DatabaseReference _roomRef, Dictionary<string, Player> _currentPlayers, Dictionary<int, Question> _questions, Action _callback_OnVoteEnded)
{ {
Debug.Log("Initializing voting page"); Debug.Log("Initializing voting page");
this.gameObject.SetActive(true);
roomRef = _roomRef; roomRef = _roomRef;
currentPlayers = _currentPlayers; currentPlayers = _currentPlayers;
OnVoteEnded = _callback_OnVoteEnded; OnVoteEnded = _callback_OnVoteEnded;
allPlayersHaveVotedForCurrentQuestion = false;
endOfTimer = DateTime.MinValue;
remainingQuestions.Clear();
currentQuestion = null;
Question[] _questionArray = _questions.Values.ToArray(); Question[] _questionArray = _questions.Values.ToArray();
numberOfQuestions = _questionArray.Length; numberOfQuestions = _questionArray.Length;
@ -111,7 +108,6 @@ public void ShowVotingPage(DatabaseReference _roomRef, Dictionary<string, Player
roomRef.Child("questions").Child(i.ToString()).ValueChanged += OnQuestionDataUpdate; roomRef.Child("questions").Child(i.ToString()).ValueChanged += OnQuestionDataUpdate;
} }
gameObject.SetActive(true);
currentQuestion = remainingQuestions.Dequeue(); currentQuestion = remainingQuestions.Dequeue();
ShowNextQuestion(); ShowNextQuestion();
} }

View File

@ -24,13 +24,6 @@ public void Initialize(Room _myRoom, Action _onPropositionFinish)
gameObject.SetActive(true); gameObject.SetActive(true);
OnPropositionFinish = _onPropositionFinish; OnPropositionFinish = _onPropositionFinish;
myRoom = _myRoom; myRoom = _myRoom;
allPlayersHasProposedTwoPictures = false;
playersIdWhoHaveProposed.Clear();
foreach(TextMeshProUGUI label in playerLabels)
{
label.color = Color.white;
}
ShowPlayerLabels(); ShowPlayerLabels();
} }