Merge branch 'main' of ssh://patema.crystalyx.net:2222/GameJams/Snaparazzi

This commit is contained in:
Marine 2024-01-28 14:43:23 +01:00
commit 2b604fdb80
21 changed files with 1658 additions and 476 deletions

8
Assets/Prefabs.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3886f5e8ed5884a99bbd7a95c2f6b27c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,323 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4654528575356896576
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2993570874611009919}
- component: {fileID: 1014643739613990429}
- component: {fileID: 782069874130417341}
m_Layer: 5
m_Name: PropositionFrame.PlayerName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2993570874611009919
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4654528575356896576}
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: 3953387086501582844}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 75}
m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &1014643739613990429
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4654528575356896576}
m_CullTransparentMesh: 1
--- !u!114 &782069874130417341
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4654528575356896576}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: 01234567890123456
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 72af27804d5aa49408430b4b2500f877, type: 2}
m_sharedMaterial: {fileID: 8890805173838430465, guid: 72af27804d5aa49408430b4b2500f877, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278190080
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 64
m_fontSizeBase: 64
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5138585656555316049
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1424407976172285298}
- component: {fileID: 2716772787860397017}
- component: {fileID: 423066451263622249}
m_Layer: 5
m_Name: PropositionFrame.Picture
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1424407976172285298
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5138585656555316049}
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: 3953387086501582844}
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: 500, y: 500}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2716772787860397017
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5138585656555316049}
m_CullTransparentMesh: 1
--- !u!114 &423066451263622249
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5138585656555316049}
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: 57d7dffbdddc24c959c3c072208cbafe, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!1 &6433924239447685472
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4509981124141486577}
- component: {fileID: 4661236625436494338}
m_Layer: 5
m_Name: PropositionFrame.VotersGrid
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4509981124141486577
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6433924239447685472}
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: 3953387086501582844}
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 &4661236625436494338
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6433924239447685472}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8a8695521f0d02e499659fee002a26c2, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 5
m_Right: 5
m_Top: 5
m_Bottom: 5
m_ChildAlignment: 4
m_StartCorner: 0
m_StartAxis: 0
m_CellSize: {x: 200, y: 100}
m_Spacing: {x: 75, y: 25}
m_Constraint: 0
m_ConstraintCount: 2
--- !u!1 &7016400590500538500
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3953387086501582844}
- component: {fileID: 9141429158838199157}
m_Layer: 5
m_Name: PropositionFrame
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3953387086501582844
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7016400590500538500}
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: 1424407976172285298}
- {fileID: 4509981124141486577}
- {fileID: 2993570874611009919}
m_Father: {fileID: 0}
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: -556, y: 0}
m_SizeDelta: {x: 500, y: 500}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &9141429158838199157
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7016400590500538500}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 18061644c95a147eb81059fa46414624, type: 3}
m_Name:
m_EditorClassIdentifier:
picture: {fileID: 423066451263622249}
voterStickerPrefab: {fileID: 4312846972391547553, guid: 69942fa558cf34dfc91982c6bccef840, type: 3}
playerName: {fileID: 782069874130417341}
playerGrid: {fileID: 4509981124141486577}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6f5bb6680660e49fd9cb0ff864a44bf4
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,262 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2462192938238515664
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4847416433156003170}
- component: {fileID: 5164741681773790499}
- component: {fileID: 2430977146559507814}
m_Layer: 5
m_Name: VoterSticker.PlayerName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4847416433156003170
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2462192938238515664}
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: 943229596838791819}
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: -10, y: -10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5164741681773790499
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2462192938238515664}
m_CullTransparentMesh: 1
--- !u!114 &2430977146559507814
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2462192938238515664}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: playernamevraimentlong
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 72af27804d5aa49408430b4b2500f877, type: 2}
m_sharedMaterial: {fileID: 8890805173838430465, guid: 72af27804d5aa49408430b4b2500f877, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 1
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &2704804050822234674
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7101168500304376256}
- component: {fileID: 3089203999989860493}
- component: {fileID: 5096287721252539344}
m_Layer: 5
m_Name: VoterSticker.Backgound
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7101168500304376256
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2704804050822234674}
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: 943229596838791819}
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!222 &3089203999989860493
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2704804050822234674}
m_CullTransparentMesh: 1
--- !u!114 &5096287721252539344
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2704804050822234674}
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: 0.854902, g: 0.75294125, b: 0.76470596, 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: 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 &4312846972391547553
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 943229596838791819}
- component: {fileID: -3919290783414862184}
m_Layer: 5
m_Name: VoterSticker
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &943229596838791819
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4312846972391547553}
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: 7101168500304376256}
- {fileID: 4847416433156003170}
m_Father: {fileID: 0}
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: -427, y: 38}
m_SizeDelta: {x: 200, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &-3919290783414862184
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4312846972391547553}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 63ba002d2116d4c54a8d55e905869d8f, type: 3}
m_Name:
m_EditorClassIdentifier:
playerNameLabel: {fileID: 2430977146559507814}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 69942fa558cf34dfc91982c6bccef840
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,6 @@ public Player(string _name, string _id, double _creationDate)
name = _name; name = _name;
id = _id; id = _id;
creationDate = _creationDate; creationDate = _creationDate;
} }
public Player(string _name) public Player(string _name)

View File

@ -18,5 +18,4 @@ public class Prompt
[field: SerializeField] [field: SerializeField]
[FirestoreProperty] [FirestoreProperty]
public string en { get; set; } public string en { get; set; }
} }

View File

@ -6,7 +6,18 @@
[JsonObject] [JsonObject]
public class Question public class Question
{ {
public string id;
public string promptId; public string promptId;
public Dictionary<string, Proposition> propositions; public Dictionary<string, Proposition> propositions;
public double creationDate; public double creationDate;
public Proposition GetFirstProposition()
{
return propositions["0"];
}
public Proposition GetSecondProposition()
{
return propositions["1"];
}
} }

View File

@ -10,7 +10,7 @@ public class Room
public string code; public string code;
public Dictionary<string, Question> questions; public Dictionary<string, Question> questions;
public Dictionary<string, Player> players; public Dictionary<string, Player> players;
public int currentQuestion; public string currentQuestionId;
public double creationDate; public double creationDate;
public int currentState; public int currentState;
@ -20,10 +20,19 @@ public Room(string _code)
creationDate = DateTime.Now.ToOADate(); creationDate = DateTime.Now.ToOADate();
players = new Dictionary<string, Player>(); players = new Dictionary<string, Player>();
questions = new Dictionary<string, Question>(); questions = new Dictionary<string, Question>();
currentQuestion = 0; currentQuestionId = "";
currentState = 1; //default by PC currentState = 1; //default by PC
} }
/// <summary>
/// Return the only player with a specific ID
/// </summary>
/// <returns></returns>
public Player GetPlayerById(string id)
{
return players[id];
}
public List<Player> GetPlayerList() public List<Player> GetPlayerList()
{ {
return new List<Player>(players.Values); return new List<Player>(players.Values);

View File

@ -337,10 +337,10 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
} }
case (int)GameState.WaitingForOtherPlayersToJoin: case (int)GameState.WaitingForOtherPlayersToJoin:
{ {
CheckIfIAmTheFirst(myRoom.GetPlayerList()); CheckIfIAmTheFirst(myRoom.GetPlayerList());
UpdateDisplayedListUser(myRoom.GetPlayerList()); UpdateDisplayedListUser(myRoom.GetPlayerList());
break; break;
} }
case (int)GameState.Explanation: case (int)GameState.Explanation:
@ -425,8 +425,8 @@ public void OnClickSubmitSignIn()
public void onClickSamePlayers() public void onClickSamePlayers()
{ {
myRoom.currentState = (int)GameState.Explanation; myRoom.currentState = (int)GameState.Explanation;
myRoom.currentQuestion = 2;
myRoom.questions = null; myRoom.questions = null;
myRoom.currentQuestionId = string.Empty;
string json = JsonUtility.ToJson(myRoom); string json = JsonUtility.ToJson(myRoom);
myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task => myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task =>
@ -441,7 +441,7 @@ public void onClickSamePlayers()
public void onClickNewPlayers() public void onClickNewPlayers()
{ {
myRoom.currentState = (int)GameState.EnteringName; myRoom.currentState = (int)GameState.EnteringName;
myRoom.currentQuestion = 0; myRoom.currentQuestionId = string.Empty;
myRoom.questions = null; myRoom.questions = null;
myRoom.players = null; myRoom.players = null;
string json = JsonUtility.ToJson(myRoom); string json = JsonUtility.ToJson(myRoom);

View File

@ -19,4 +19,9 @@ private void CreateEntry()
}; };
prompts.Add(temp); prompts.Add(temp);
} }
public Prompt GetPromptById(string _id)
{
return prompts.Find(x => x.id == _id);
}
} }

View File

@ -0,0 +1,81 @@
using System.Collections;
using System.Collections.Generic;
using Firebase.Extensions;
using Firebase.Storage;
using TMPro;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
public class PropositionFrame : MonoBehaviour
{
public RawImage picture;
public GameObject voterStickerPrefab;
public TextMeshProUGUI playerName;
public Transform playerGrid;
private List<Player> currentVoters = new List<Player>();
private Proposition proposition;
public void Initialize(Proposition _proposition)
{
Debug.Log($"Initializing {_proposition.owner}'s proposition", this);
proposition = _proposition;
DisplayPicture(proposition.photoUrl);
playerName.text = proposition.owner.name;
}
private void DisplayPicture(string _url)
{
Debug.Log($"Downloading {_url}");
StorageReference imageRef = FirebaseStorage.DefaultInstance.GetReferenceFromUrl(_url);
imageRef.GetDownloadUrlAsync().ContinueWithOnMainThread(task =>
{
if (task.IsFaulted || task.IsCanceled)
{
Debug.LogException(task.Exception);
}
else
{
Debug.Log("Download URL: " + task.Result);
StartCoroutine(DownloadImage(task.Result.AbsolutePath, _texture =>
{
Debug.Log("Set texture in the raw image");
picture.texture = _texture;
}));
}
});
}
private IEnumerator DownloadImage(string _url, System.Action<Texture> callback_OnTextureDownloaded)
{
UnityWebRequest request = UnityWebRequestTexture.GetTexture(_url);
yield return request.SendWebRequest();
if (request.result != UnityWebRequest.Result.Success)
{
Debug.LogError(request.error);
}
else
{
callback_OnTextureDownloaded?.Invoke(((DownloadHandlerTexture)request.downloadHandler).texture);
}
}
public void UpdateVoters(List<Player> _newVoters)
{
Debug.Log($"There are some new voters for {proposition.owner}'s proposition", this);
foreach (Player p in _newVoters)
{
if (!currentVoters.Contains(p))
{
currentVoters.Add(p);
VoterSticker sticker = Instantiate(voterStickerPrefab, playerGrid).GetComponent<VoterSticker>();
sticker.playerNameLabel.text = p.name;
Debug.Log($"{p.name} has just voted for {proposition.owner.name}'s proposition.");
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 18061644c95a147eb81059fa46414624
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -32,26 +32,19 @@ void Redraw(int currentQuestion)
cameraManager.WebcamResume(); cameraManager.WebcamResume();
} }
string GetQuestionRef(string promptId) string GetPropRef(string playerId)
{ {
return gameManager.myRoom.questions.First(x => x.Value.promptId == promptId).Key; return gameManager.myRoom.questions[(currentQuestion - 1).ToString()].propositions.First(x => x.Value.owner.id == playerId).Key;
}
string GetPropRef(string questionRef, string playerId)
{
return gameManager.myRoom.questions[questionRef].propositions.First(x => x.Value.owner.id == playerId).Key;
} }
public void OnSubmitButton() public void OnSubmitButton()
{ {
string questionRef = GetQuestionRef(player2questions[currentQuestion - 1].promptId);
StorageManager storageManager = managers.GetComponent<StorageManager>(); StorageManager storageManager = managers.GetComponent<StorageManager>();
storageManager.UploadPhoto( storageManager.UploadPhoto(
gameManager.myRoom.code, gameManager.myRoom.code,
gameManager.currentPlayer.id, gameManager.currentPlayer.id,
GetQuestionRef(questionRef), currentQuestion,
GetPropRef(questionRef, gameManager.currentPlayer.id)); GetPropRef(gameManager.currentPlayer.id));
if (currentQuestion < 2) { if (currentQuestion < 2) {
Redraw(++currentQuestion); Redraw(++currentQuestion);

View File

@ -6,6 +6,7 @@
using UnityEngine; using UnityEngine;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Linq; using System.Linq;
using Google.MiniJSON;
public class RoomManager : MonoBehaviour public class RoomManager : MonoBehaviour
{ {
@ -35,24 +36,12 @@ public class RoomManager : MonoBehaviour
private bool allPlayersHasProposedTwoPictures = false; private bool allPlayersHasProposedTwoPictures = false;
private Dictionary<string, Proposition[]> propositionsPerPlayers = new Dictionary<string, Proposition[]>(); private Dictionary<string, Proposition[]> propositionsPerPlayers = new Dictionary<string, Proposition[]>();
[Header("Waiting For Proposition Page")]
public VotingPage votingPage;
[Header("Other")] [Header("Other")]
public PromptList promptList; public PromptList promptList;
private Room myRoom = null; private Room myRoom = null;
public float votingTime = 20;
private float votingCurrentTime = 0;
/// <summary>
/// Contain the infos about the current displayed question (during votes)
/// </summary>
private Question currentQuestion;
private List<Question> questions;
/// <summary>
/// When this is equal to questions.Count, go to score page
/// </summary>
private int numberOfQuestionVoted = 0;
DatabaseReference realtimeDB; DatabaseReference realtimeDB;
@ -66,8 +55,6 @@ private void Start()
explanationPage.SetActive(false); explanationPage.SetActive(false);
waitingForPropositionsPage.SetActive(false); waitingForPropositionsPage.SetActive(false);
waitingForPlayersPage.SetActive(true); waitingForPlayersPage.SetActive(true);
votingCurrentTime = votingTime;
ResetAllPlayerLabels(); ResetAllPlayerLabels();
} }
@ -298,43 +285,27 @@ public void HostHasStartedGame()
public void GeneratePrompts() public void GeneratePrompts()
{ {
System.Random rnd = new(); System.Random rnd = new();
List<Prompt> prompts = promptList.prompts.OrderBy(x => rnd.Next()).Take(myRoom.players.Count() * 2).ToList(); List<Prompt> prompts = promptList.prompts.OrderBy(x => rnd.Next()).Take(myRoom.players.Count()).ToList();
List<Player> fullPlayers = myRoom.players.Values.ToList().Concat(myRoom.players.Values.ToList()).OrderBy(x => rnd.Next()).ToList(); List<Player> players = myRoom.players.Values.ToList().OrderBy(x => rnd.Next()).ToList();
Dictionary<string, Question> questions = new(); Dictionary<string, Question> questions = new();
foreach (Prompt prompt in prompts) for (int i = 0; i < players.Count(); i++)
{ {
Dictionary<string, Proposition> propositions = new(); Dictionary<string, Proposition> propositions = new();
Player basePlayer = fullPlayers[0];
propositions.Add(Guid.NewGuid().ToString(), new Proposition() for (int j = 0; j < 2; j++)
{ {
owner = basePlayer, propositions.Add(j.ToString(), new Proposition()
creationDate = DateTime.Now.ToOADate()
});
//fullPlayers.RemoveAt(0);
for (int i = 1; i < fullPlayers.Count(); i++)
{
Player secondPlayer = fullPlayers[i];
if (basePlayer.id != secondPlayer.id)
{ {
propositions.Add(Guid.NewGuid().ToString(), new Proposition() owner = players[i + j < players.Count() ? i + j : 0],
{ creationDate = DateTime.Now.ToOADate()
owner = secondPlayer, });
creationDate = DateTime.Now.ToOADate()
});
fullPlayers.RemoveAt(0);
break;
}
} }
questions.Add(Guid.NewGuid().ToString(), new Question() questions.Add(i.ToString(), new Question()
{ {
promptId = prompt.id, id = Guid.NewGuid().ToString(),
promptId = prompts[i].id,
propositions = propositions, propositions = propositions,
creationDate = DateTime.Now.ToOADate(), creationDate = DateTime.Now.ToOADate(),
}); });
@ -406,21 +377,34 @@ private void OnNewGameStateStarted()
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");
waitingForPlayersPage.SetActive(false); waitingForPlayersPage.SetActive(false);
explanationPage.SetActive(true); explanationPage.SetActive(true);
endOfExplanationDate = DateTime.Now.AddSeconds(explanationTime); endOfExplanationDate = DateTime.Now.AddSeconds(explanationTime);
AudioSource.PlayClipAtPoint(counterSFX, Vector3.zero); AudioSource.PlayClipAtPoint(counterSFX, Vector3.zero);
//generate all the questions during the explanation //generate all the questions during the explanation
GeneratePrompts(); GeneratePrompts();
break; break;
case (int)GameState.MakeProposition: case (int)GameState.MakeProposition:
Debug.Log("New State : MakeProposition"); Debug.Log("New State : MakeProposition");
HostHasStartedGame(); HostHasStartedGame();
break; break;
case (int)GameState.MakeVote:
votingPage.ShowVotingPage(
realtimeDB.Child("rooms").Child(myRoom.code)
, myRoom.players
, myRoom.questions
, () => SendRoomState(GameState.Score));
break;
case (int)GameState.Score:
//something
break;
default: default:
break; break;
} }

View File

@ -33,7 +33,7 @@ void Update()
} }
public void UploadPhoto(string roomCode, string playerId, string questionRef, string propRef) public void UploadPhoto(string roomCode, string playerId, int question, string proposition)
{ {
Texture2D photo = gameObject.GetComponent<CameraManager>().GetPhoto(); Texture2D photo = gameObject.GetComponent<CameraManager>().GetPhoto();
byte[] photoBytes = ImageConversion.EncodeToJPG(photo); byte[] photoBytes = ImageConversion.EncodeToJPG(photo);
@ -41,7 +41,7 @@ public void UploadPhoto(string roomCode, string playerId, string questionRef, st
GameManager game = gameObject.GetComponent<GameManager>(); GameManager game = gameObject.GetComponent<GameManager>();
string imageUuid = Guid.NewGuid().ToString(); string imageUuid = Guid.NewGuid().ToString();
StorageReference imageRef = storage.Child($"{game.myRoom.code}/{game.currentPlayer.id}/{imageUuid}.png"); StorageReference imageRef = storage.Child($"{roomCode}/{playerId}/{imageUuid}.png");
imageRef.PutBytesAsync(photoBytes).ContinueWith((Task<StorageMetadata> task) => imageRef.PutBytesAsync(photoBytes).ContinueWith((Task<StorageMetadata> task) =>
{ {
@ -52,9 +52,15 @@ public void UploadPhoto(string roomCode, string playerId, string questionRef, st
} }
else else
{ {
// Metadata contains file metadata such as size, content-type, and md5hash. realtimeDB
StorageMetadata metadata = task.Result; .Child("rooms")
.Child(roomCode)
.Child("questions")
.Child(question.ToString())
.Child("propositions")
.Child(proposition)
.Child("photoUrl")
.SetValueAsync(imageRef.Path);
} }
}); });

View File

@ -0,0 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class VoterSticker : MonoBehaviour
{
public TextMeshProUGUI playerNameLabel;
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 63ba002d2116d4c54a8d55e905869d8f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,131 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Firebase.Database;
using TMPro;
using UnityEngine;
public class VotingPage : MonoBehaviour
{
[Header("Scene References")]
public PropositionFrame proposition1;
public PropositionFrame proposition2;
public TextMeshProUGUI currentPromptLabel;
public TextMeshProUGUI timerLabel;
[Header("Asset References")]
public PromptList promptList;
[Header("Settings")]
public float votingTime = 20;
private Queue<Question> remainingQuestions = new Queue<Question>();
private Question currentQuestion = null;
private DatabaseReference roomRef;
private Dictionary<string, Player> currentPlayers; //all the current playing players
private DateTime endOfTimer = DateTime.MinValue;
private Action OnVoteEnded;
private void Update()
{
//there is no question displayed or timer is not started
if (currentQuestion == null || endOfTimer == DateTime.MinValue)
return;
if (endOfTimer <= DateTime.Now)
{
timerLabel.text = "0";
if (remainingQuestions.Count > 0)
{
currentQuestion = remainingQuestions.Dequeue();
ShowQuestion();
}
else
{
OnVoteEnded?.Invoke();
}
}
else
{
timerLabel.text = (DateTime.Now - endOfTimer).ToString("D2");
}
}
// Start is called before the first frame update
public void ShowVotingPage(DatabaseReference _roomRef, Dictionary<string, Player> _currentPlayers, Dictionary<string, Question> _questions, Action _callback_OnVoteEnded)
{
Debug.Log("Initializing voting page");
this.gameObject.SetActive(true);
roomRef = _roomRef;
currentPlayers = _currentPlayers;
OnVoteEnded = _callback_OnVoteEnded;
foreach (var QuestionByID in _questions)
{
remainingQuestions.Enqueue(QuestionByID.Value);
roomRef.Child("questions").Child(QuestionByID.Key).ValueChanged += OnQuestionChanged;
}
currentQuestion = remainingQuestions.Dequeue();
roomRef.Child("currentQuestion").SetValueAsync(currentQuestion.id);
ShowQuestion();
}
void ShowQuestion()
{
Debug.Log($"Show Question {currentQuestion.promptId}", this);
Prompt currentPrompt = promptList.GetPromptById(currentQuestion.promptId);
currentPromptLabel.text = currentPrompt.en;
Debug.Log($"Prompt is {currentPromptLabel.text}", this);
proposition1.Initialize(currentQuestion.GetFirstProposition());
proposition1.Initialize(currentQuestion.GetSecondProposition());
endOfTimer = DateTime.Now.AddSeconds(votingTime);
}
/// <summary>
/// Is called when a question is updated (someone has voted)
/// </summary>
/// <param name="sender"></param>
/// <param name="_questionRef"></param>
private void OnQuestionChanged(object sender, ValueChangedEventArgs _questionRef)
{
Debug.Log("a question value has changed, maybe someone has voted", this);
string JSON = _questionRef.Snapshot.GetRawJsonValue();
Question question = Newtonsoft.Json.JsonConvert.DeserializeObject<Question>(JSON);
//if someone succeeded to vote for another question than the one that is displayed => yeet
if (question.id != currentQuestion.id)
return;
Debug.Log($"someone has voted for {question.id}", this);
currentQuestion.propositions = question.propositions;
UpdateVoters();
}
private void UpdateVoters()
{
List<Player> playersThatHasVotedForFirstProposition = new List<Player>();
foreach (string playerId in currentQuestion.GetFirstProposition().voters)
{
playersThatHasVotedForFirstProposition.Add(currentPlayers[playerId]);
}
List<Player> playersThatHasVotedForSecondProposition = new List<Player>();
foreach (string playerId in currentQuestion.GetSecondProposition().voters)
{
playersThatHasVotedForSecondProposition.Add(currentPlayers[playerId]);
}
proposition1.UpdateVoters(playersThatHasVotedForFirstProposition);
proposition2.UpdateVoters(playersThatHasVotedForSecondProposition);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 18219aa91e9f14d64b46209ebcc6d0d9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: