feat: add HttpClient to comunicate with web api

This commit is contained in:
cuqmbr 2022-07-19 00:03:03 +03:00
parent b50829e510
commit 242a55da13
19 changed files with 693 additions and 190 deletions

8
Assets/Animations.meta generated Normal file
View File

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

View File

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

View File

@ -134,7 +134,7 @@ GameObject:
- component: {fileID: 35713922}
- component: {fileID: 35713924}
- component: {fileID: 35713923}
m_Layer: 0
m_Layer: 5
m_Name: Score Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -267,7 +267,7 @@ GameObject:
m_Component:
- component: {fileID: 98179538}
- component: {fileID: 98179539}
m_Layer: 0
m_Layer: 5
m_Name: Border Right
m_TagString: Wall
m_Icon: {fileID: 0}
@ -328,7 +328,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 221840723}
m_Layer: 0
m_Layer: 5
m_Name: Canvases
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -347,7 +347,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 565597293}
- {fileID: 1305720406}
- {fileID: 1064798218}
m_Father: {fileID: 0}
m_RootOrder: 6
@ -410,7 +409,7 @@ GameObject:
m_Component:
- component: {fileID: 333766463}
- component: {fileID: 333766464}
m_Layer: 0
m_Layer: 5
m_Name: Border Left
m_TagString: Wall
m_Icon: {fileID: 0}
@ -617,7 +616,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 22d67772d88b5bdf9bf26d8099d85dd7, type: 3}
m_Name:
m_EditorClassIdentifier:
_targetedFramerate: 0
_targetedFramerate: 60
--- !u!1 &547016913
GameObject:
m_ObjectHideFlags: 0
@ -630,7 +629,7 @@ GameObject:
- component: {fileID: 547016916}
- component: {fileID: 547016915}
- component: {fileID: 547016917}
m_Layer: 0
m_Layer: 5
m_Name: Touch Image
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -735,7 +734,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 565597289}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
@ -822,7 +821,7 @@ GameObject:
- component: {fileID: 654118517}
- component: {fileID: 654118519}
- component: {fileID: 654118518}
m_Layer: 0
m_Layer: 5
m_Name: Title Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -992,6 +991,140 @@ Transform:
m_Father: {fileID: 1037654666}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &851431057
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 851431058}
- component: {fileID: 851431060}
- component: {fileID: 851431059}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &851431058
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 851431057}
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_Children: []
m_Father: {fileID: 1956364944}
m_RootOrder: 0
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 &851431059
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 851431057}
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: Restart
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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: 72
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 1
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!222 &851431060
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 851431057}
m_CullTransparentMesh: 1
--- !u!1 &878931746
GameObject:
m_ObjectHideFlags: 0
@ -1031,7 +1164,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 988032567}
m_Layer: 0
m_Layer: 5
m_Name: Hand
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1152,13 +1285,13 @@ GameObject:
- component: {fileID: 1025198877}
- component: {fileID: 1025198879}
- component: {fileID: 1025198878}
m_Layer: 0
m_Name: Main Menu UI
m_Layer: 5
m_Name: Main Menu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1025198877
RectTransform:
m_ObjectHideFlags: 0
@ -1193,7 +1326,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.8584906, g: 0.81922555, b: 0.376602, a: 1}
m_Color: {r: 0.8235294, g: 0.8105379, b: 0.44705883, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@ -1403,7 +1536,7 @@ GameObject:
- component: {fileID: 1041961126}
- component: {fileID: 1041961128}
- component: {fileID: 1041961127}
m_Layer: 0
m_Layer: 5
m_Name: Star Image
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1479,7 +1612,7 @@ GameObject:
- component: {fileID: 1064798221}
- component: {fileID: 1064798220}
- component: {fileID: 1064798219}
m_Layer: 0
m_Layer: 5
m_Name: UI Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1498,10 +1631,10 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1025198877}
- {fileID: 1547625340}
- {fileID: 1119517689}
- {fileID: 1877493306}
m_Father: {fileID: 221840723}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -1610,7 +1743,7 @@ GameObject:
- component: {fileID: 1114100291}
- component: {fileID: 1114100293}
- component: {fileID: 1114100292}
m_Layer: 0
m_Layer: 5
m_Name: Multiplier Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1742,13 +1875,13 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1119517689}
m_Layer: 0
m_Name: Score UI
m_Layer: 5
m_Name: Game Menu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1119517689
RectTransform:
m_ObjectHideFlags: 0
@ -1756,15 +1889,15 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1119517688}
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_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 35713922}
- {fileID: 2325626163454522011}
- {fileID: 1542726291}
m_Father: {fileID: 1305720406}
m_RootOrder: 0
m_Father: {fileID: 1064798218}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -1857,7 +1990,7 @@ GameObject:
- component: {fileID: 1251805421}
- component: {fileID: 1251805420}
- component: {fileID: 1251805422}
m_Layer: 0
m_Layer: 5
m_Name: Hand base Image
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1936,106 +2069,6 @@ MonoBehaviour:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
m_EffectDistance: {x: 1, y: -1}
m_UseGraphicAlpha: 1
--- !u!1 &1305720405
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1305720406}
- component: {fileID: 1305720409}
- component: {fileID: 1305720408}
- component: {fileID: 1305720407}
m_Layer: 0
m_Name: Score Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1305720406
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1305720405}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1119517689}
m_Father: {fileID: 221840723}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1305720407
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1305720405}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1305720408
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1305720405}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 720, y: 1280}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!223 &1305720409
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1305720405}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 1
m_Camera: {fileID: 1638983507}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: -100
m_TargetDisplay: 0
--- !u!1 &1542726290
GameObject:
m_ObjectHideFlags: 0
@ -2045,7 +2078,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1542726291}
m_Layer: 0
m_Layer: 5
m_Name: Star Image Parent
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -2074,41 +2107,6 @@ RectTransform:
m_AnchoredPosition: {x: 192, y: 448}
m_SizeDelta: {x: 107, y: 107}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1547625339
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1547625340}
m_Layer: 0
m_Name: InGame UI
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &1547625340
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1547625339}
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_Children: []
m_Father: {fileID: 1064798218}
m_RootOrder: 1
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!1 &1638983504
GameObject:
m_ObjectHideFlags: 0
@ -2159,7 +2157,7 @@ Camera:
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.49529448, g: 0.85882354, b: 0.3764706, a: 0}
m_BackGroundColor: {r: 0.5411765, g: 0.8235294, b: 0.44705883, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
@ -2235,6 +2233,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 51461a5e829c16567902ce08ad663025, type: 3}
m_Name:
m_EditorClassIdentifier:
_mainMenu: {fileID: 1025198876}
_gameMenu: {fileID: 1119517688}
_gameOverMenu: {fileID: 1877493305}
_scoreText: {fileID: 35713923}
_experienceSlider: {fileID: 2325626163454522012}
_multiplierText: {fileID: 1114100292}
@ -2314,8 +2315,8 @@ GameObject:
- component: {fileID: 1877493306}
- component: {fileID: 1877493308}
- component: {fileID: 1877493307}
m_Layer: 0
m_Name: Game Over UI
m_Layer: 5
m_Name: Game Over Menu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -2331,7 +2332,8 @@ RectTransform:
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_Children: []
m_Children:
- {fileID: 1956364944}
m_Father: {fileID: 1064798218}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -2353,7 +2355,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.85882354, g: 0.43667537, b: 0.3764706, a: 1}
m_Color: {r: 0.8235294, g: 0.49330506, b: 0.44705883, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@ -2378,6 +2380,139 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1877493305}
m_CullTransparentMesh: 1
--- !u!1 &1956364943
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1956364944}
- component: {fileID: 1956364947}
- component: {fileID: 1956364946}
- component: {fileID: 1956364945}
m_Layer: 5
m_Name: Restart Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1956364944
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1956364943}
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_Children:
- {fileID: 851431058}
m_Father: {fileID: 1877493306}
m_RootOrder: 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: 0, y: -448}
m_SizeDelta: {x: 389.93, y: 105.69}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1956364945
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1956364943}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, 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: 1956364946}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1164961474}
m_TargetAssemblyTypeName: GameStateController, Assembly-CSharp
m_MethodName: ChangeState
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: Menu
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1956364946
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1956364943}
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!222 &1956364947
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1956364943}
m_CullTransparentMesh: 1
--- !u!1 &1988368218
GameObject:
m_ObjectHideFlags: 0
@ -2418,7 +2553,7 @@ GameObject:
m_Component:
- component: {fileID: 2001289698}
- component: {fileID: 2001289699}
m_Layer: 0
m_Layer: 5
m_Name: Trigger Death
m_TagString: Floor
m_Icon: {fileID: 0}
@ -2586,7 +2721,7 @@ GameObject:
- component: {fileID: 2115337845}
- component: {fileID: 2115337847}
- component: {fileID: 2115337846}
m_Layer: 0
m_Layer: 5
m_Name: Star Image Background
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -2675,7 +2810,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3768637720116437164, guid: e888b07bccd19c6b48e082f0698de4bd, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4246834057316494452, guid: e888b07bccd19c6b48e082f0698de4bd, type: 3}
propertyPath: m_Layer
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4847339781350168754, guid: e888b07bccd19c6b48e082f0698de4bd, type: 3}
propertyPath: m_Layer
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4892302239744106471, guid: e888b07bccd19c6b48e082f0698de4bd, type: 3}
propertyPath: m_Pivot.x
@ -2761,10 +2904,18 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6441504904042339064, guid: e888b07bccd19c6b48e082f0698de4bd, type: 3}
propertyPath: m_Layer
value: 5
objectReference: {fileID: 0}
- target: {fileID: 7256145079461275005, guid: e888b07bccd19c6b48e082f0698de4bd, type: 3}
propertyPath: m_Name
value: Experience Slider
objectReference: {fileID: 0}
- target: {fileID: 7256145079461275005, guid: e888b07bccd19c6b48e082f0698de4bd, type: 3}
propertyPath: m_Layer
value: 5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e888b07bccd19c6b48e082f0698de4bd, type: 3}
--- !u!224 &2325626163454522011 stripped

BIN
Assets/SharedModels.dll Normal file

Binary file not shown.

33
Assets/SharedModels.dll.meta generated Normal file
View File

@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: e126d8166d6622919a5147e8e6d4480c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Sprites.meta generated Normal file
View File

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

BIN
Assets/Sprites/Circle.png (Stored with Git LFS) Normal file

Binary file not shown.

180
Assets/Sprites/Circle.png.meta generated Normal file
View File

@ -0,0 +1,180 @@
fileFormatVersion: 2
guid: 8df8ea7e11d4d56c598bf829142fec69
TextureImporter:
internalIDToNameTable:
- first:
213: -2413806693520163455
second: Circle
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 256
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Circle
rect:
serializedVersion: 2
x: 0
y: 0
width: 256
height: 256
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline:
- - {x: -33, y: 128}
- {x: -95, y: 95}
- {x: -128, y: 33}
- {x: -128, y: -33}
- {x: -95, y: -95}
- {x: -33, y: -128}
- {x: 33, y: -128}
- {x: 95, y: -95}
- {x: 128, y: -33}
- {x: 128, y: 33}
- {x: 95, y: 95}
- {x: 33, y: 128}
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 18d3544e99f608ed0800000000000000
internalID: -2413806693520163455
vertices: []
indices:
edges: []
weights: []
outline:
- - {x: -33, y: 128}
- {x: -95, y: 95}
- {x: -128, y: 33}
- {x: -128, y: -33}
- {x: -95, y: -95}
- {x: -33, y: -128}
- {x: 33, y: -128}
- {x: 95, y: -95}
- {x: 128, y: -33}
- {x: 128, y: 33}
- {x: 95, y: 95}
- {x: 33, y: 128}
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,65 @@
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using UnityEngine.Networking;
public static class HttpClient
{
public static async Task<T> Get<T>(string endpoint)
{
var getRequest = CreateRequest(endpoint, RequestType.GET);
getRequest.SendWebRequest();
while (getRequest.isDone)
{
await Task.Delay(10);
}
return JsonConvert.DeserializeObject<T>(getRequest.downloadHandler.text);
}
public static async Task<T> Post<T>(string endpoint, object payload)
{
var postRequest = CreateRequest(endpoint, RequestType.POST, payload);
postRequest.SendWebRequest();
while (postRequest.isDone)
{
await Task.Delay(10);
}
return JsonConvert.DeserializeObject<T>(postRequest.downloadHandler.text);
}
private static UnityWebRequest CreateRequest(string path, RequestType type, object data = null)
{
var request = new UnityWebRequest(path, type.ToString());
if (data != null)
{
var bodyRaw = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(data));
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
}
request.downloadHandler = new DownloadHandlerBuffer();
request.SetRequestHeader("Content-Type", "application/json");
request.certificateHandler = new CertificateWhore();
return request;
}
public enum RequestType
{
GET = 0,
POST = 1
}
}
public class CertificateWhore : CertificateHandler
{
protected override bool ValidateCertificate(byte[] certificateData)
{
return true;
}
}

3
Assets/_Scripts/HttpClient.cs.meta generated Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9cc7d747c63f41cb8e9d5a4a143aa733
timeCreated: 1658176324

View File

@ -5,7 +5,7 @@ public class GameStateController : MonoBehaviour
[Tooltip("Selected state will be applied when the game starts or on the button press")]
public GameState ChangeToState;
private void Awake()
private void Start()
{
// Change game state to state selected in inspector when the game starts
GameStateManager.Instance.ChangeState(ChangeToState);

View File

@ -14,16 +14,7 @@ public class GameStateManager
// Make a singleton to be able to easily access game state manager from any script
private static GameStateManager _instance;
public static GameStateManager Instance
{
get
{
if (_instance == null)
_instance = new GameStateManager();
return _instance;
}
}
public static GameStateManager Instance => _instance ??= new GameStateManager();
// Current game state
public GameState CurrentGameState { get; private set; }

View File

@ -1,4 +1,5 @@
using System;
using DatabaseModels.DataTransferObjets;
using UnityEngine;
public class ScoreManager : MonoBehaviour
@ -23,7 +24,7 @@ public class ScoreManager : MonoBehaviour
[Header("UI")]
[SerializeField] private UIManager uiManager;
private void Awake()
private async void Awake()
{
// Get _bestAllTimeScore if available or set it to 0
@ -32,6 +33,8 @@ public class ScoreManager : MonoBehaviour
PlayerEvents.OnWallTouched += ResetMultiplierAndReward;
GameStateManager.Instance.OnGameStateChange += OnGameStateChange;
var sbRecordDto = await HttpClient.Get<ScoreboardRecordDto>("https://localhost:7248/api/scoreboard/cuqmbr");
}
private void OnDestroy()
@ -114,6 +117,8 @@ public class ScoreManager : MonoBehaviour
#endif
}
private bool IsHighScore => PlayerPrefs.GetInt("HighScore", 0) < _currentScore;
private void OnGameStateChange(GameState newGameState)
{
switch (newGameState)

View File

@ -1,14 +1,31 @@
using System;
using DatabaseModels.Requests;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class UIManager : MonoBehaviour
{
[Header("Score UI")]
[Header("UI Canvas")]
[SerializeField] private GameObject _mainMenu;
[SerializeField] private GameObject _gameMenu;
[SerializeField] private GameObject _gameOverMenu;
[Header("Score Menu")]
[SerializeField] private TextMeshProUGUI _scoreText;
[SerializeField] private Slider _experienceSlider;
[SerializeField] private TextMeshProUGUI _multiplierText;
private void Awake()
{
GameStateManager.Instance.OnGameStateChange += OnGameStateChange;
}
private void OnDestroy()
{
GameStateManager.Instance.OnGameStateChange -= OnGameStateChange;
}
public void SetScoreText(int value) => _scoreText.text = value.ToString();
public void SetExperienceSliderValue(int value) => _experienceSlider.value = value;
@ -16,4 +33,27 @@ public class UIManager : MonoBehaviour
public void SetExperienceSliderMaxValue(int value) => _experienceSlider.maxValue = value;
public void SetMultiplierText(int value) => _multiplierText.text = $"×{value}";
private void OnGameStateChange(GameState newGameState)
{
switch (newGameState)
{
case GameState.Enter:
break;
case GameState.Menu:
_gameOverMenu.SetActive(false);
_mainMenu.SetActive(true);
break;
case GameState.Game:
_mainMenu.SetActive(false);
_gameMenu.SetActive(true);
break;
case GameState.GameOver:
_gameMenu.SetActive(false);
_gameOverMenu.SetActive(true);
break;
default:
throw new ArgumentOutOfRangeException(nameof(newGameState), newGameState, null);
}
}
}

View File

@ -4,9 +4,9 @@ public class PlayerCollisions : MonoBehaviour
{
[SerializeField] private ScoreManager _scoreManager;
private void OnCollisionEnter2D(Collision2D col)
private void OnCollisionEnter2D(Collision2D coll)
{
switch (col.gameObject.tag)
switch (coll.gameObject.tag)
{
case "Wall":
PlayerEvents.SendWallTouched();

View File

@ -86,7 +86,7 @@ public class PlayerController : MonoBehaviour
{
// Change gravitational force over height
if (GameStateManager.Instance.CurrentGameState == GameState.Game && transform.position.y > _startPosition.y)
_rigidbody.gravityScale = _initialGravityScale + ((transform.position.y - _initialPositionY) * _gravityMultiplier);
_rigidbody.gravityScale = _initialGravityScale + (transform.position.y - _initialPositionY) * _gravityMultiplier;
}
private void FixedUpdate()
@ -95,4 +95,4 @@ public class PlayerController : MonoBehaviour
if (GameStateManager.Instance.CurrentGameState == GameState.Menu)
transform.position = Vector3.Lerp(transform.position, _startPosition, 0.15f);
}
}
}

View File

@ -7,6 +7,7 @@
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ide.rider": "2.0.7",
"com.unity.inputsystem": "1.3.0",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.test-framework": "1.1.29",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",

View File

@ -97,6 +97,13 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.29",
"depth": 0,

View File

@ -12,11 +12,11 @@ MonoBehaviour:
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_EnablePreviewPackages: 0
m_EnablePackageDependencies: 0
m_EnablePreviewPackages: 1
m_EnablePackageDependencies: 1
m_AdvancedSettingsExpanded: 1
m_ScopedRegistriesSettingsExpanded: 1
oneTimeWarningShown: 0
oneTimeWarningShown: 1
m_Registries:
- m_Id: main
m_Name: