feat: add raw integration with an api
This commit is contained in:
parent
91b1cf1458
commit
6de70f68f9
702
Assets/Scenes/SampleScene.unity
generated
702
Assets/Scenes/SampleScene.unity
generated
@ -394,7 +394,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2669b7102c53f757b82f593178e49647, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_initialRewardMultiplier: 500
|
||||
_initialRewardMultiplier: 15
|
||||
_maxRewardMultiplier: 128
|
||||
_initialMaxExperience: 3
|
||||
_uiManager: {fileID: 1676064789}
|
||||
@ -906,6 +906,140 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 427094482}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &428573333
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 428573334}
|
||||
- component: {fileID: 428573336}
|
||||
- component: {fileID: 428573335}
|
||||
m_Layer: 5
|
||||
m_Name: 'Num. Username: Score Text (TMP)'
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &428573334
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 428573333}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.99968, y: 0.99968, z: 0.99968}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 696254166}
|
||||
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: -40, y: -20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &428573335
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 428573333}
|
||||
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: '725. Lollex: 178'
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: c3e5b53da86c32731943004a1b8b590e, type: 2}
|
||||
m_sharedMaterial: {fileID: -8174794354313175153, guid: c3e5b53da86c32731943004a1b8b590e, 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: 60.1
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
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 &428573336
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 428573333}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &477184383
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1082,6 +1216,112 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 488822477}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1001 &564126100
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 1299477820}
|
||||
m_Modifications:
|
||||
- target: {fileID: 7150267415123359698, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Scoreboard Record (1)
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359698, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 100
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -250
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
--- !u!224 &564126101 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
m_PrefabInstance: {fileID: 564126100}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &565597289
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1225,7 +1465,7 @@ RectTransform:
|
||||
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: 450, y: 500}
|
||||
m_SizeDelta: {x: 450, y: 520}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &624579874
|
||||
MonoBehaviour:
|
||||
@ -1489,6 +1729,99 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 675090501}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &696254165
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 696254166}
|
||||
- component: {fileID: 696254169}
|
||||
- component: {fileID: 696254168}
|
||||
- component: {fileID: 696254167}
|
||||
m_Layer: 5
|
||||
m_Name: Scoreboard Record (2)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &696254166
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 696254165}
|
||||
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: 428573334}
|
||||
m_Father: {fileID: 1299477820}
|
||||
m_RootOrder: 3
|
||||
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: -350}
|
||||
m_SizeDelta: {x: 0, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &696254167
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 696254165}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 97bc2ebab6563400c95b036136d26ea6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Inverse: 0
|
||||
m_MaskInteraction: 85
|
||||
m_UseStencil: 1
|
||||
m_RaycastFilter: 0
|
||||
--- !u!114 &696254168
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 696254165}
|
||||
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.74509805, g: 0.74509805, b: 0.74509805, 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: 7482667652216324306, guid: 698ec1e99c7d691dca7b43e843782f2f, type: 3}
|
||||
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 &696254169
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 696254165}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &710340420
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1536,6 +1869,112 @@ Transform:
|
||||
m_Father: {fileID: 1037654666}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &862922468
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 1299477820}
|
||||
m_Modifications:
|
||||
- target: {fileID: 7150267415123359698, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Scoreboard Record (3)
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359698, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 100
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -450
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
--- !u!224 &862922469 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 7150267415123359699, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
m_PrefabInstance: {fileID: 862922468}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &867350546
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2356,6 +2795,99 @@ Transform:
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 8
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1092054271
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1092054272}
|
||||
- component: {fileID: 1092054275}
|
||||
- component: {fileID: 1092054274}
|
||||
- component: {fileID: 1092054273}
|
||||
m_Layer: 5
|
||||
m_Name: Scoreboard Record (4)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1092054272
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1092054271}
|
||||
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: 1811835082}
|
||||
m_Father: {fileID: 1299477820}
|
||||
m_RootOrder: 5
|
||||
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: -550}
|
||||
m_SizeDelta: {x: 0, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1092054273
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1092054271}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 97bc2ebab6563400c95b036136d26ea6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Inverse: 0
|
||||
m_MaskInteraction: 85
|
||||
m_UseStencil: 1
|
||||
m_RaycastFilter: 0
|
||||
--- !u!114 &1092054274
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1092054271}
|
||||
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.74509805, g: 0.74509805, b: 0.74509805, 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: 7482667652216324306, guid: 698ec1e99c7d691dca7b43e843782f2f, type: 3}
|
||||
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 &1092054275
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1092054271}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1114100290
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2651,13 +3183,17 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 1911471411}
|
||||
- {fileID: 340008050}
|
||||
- {fileID: 564126101}
|
||||
- {fileID: 696254166}
|
||||
- {fileID: 862922469}
|
||||
- {fileID: 1092054272}
|
||||
m_Father: {fileID: 1022150241}
|
||||
m_RootOrder: 0
|
||||
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: -0.00022219129}
|
||||
m_SizeDelta: {x: 0, y: 523.19}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!1 &1457871091
|
||||
GameObject:
|
||||
@ -3024,7 +3560,7 @@ MonoBehaviour:
|
||||
_rewardMultiplierText: {fileID: 1114100292}
|
||||
_experienceSlider: {fileID: 2325626163454522012}
|
||||
_sliderSmoothTime: 0.1
|
||||
_scoreboardScrollViewContent: {fileID: 1299477819}
|
||||
_scoreboardScrollViewContent: {fileID: 1299477820}
|
||||
_scoreboardRecordPrefab: {fileID: 7150267415123359698, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
_scoreboardRecordColor1: {r: 0.82363623, g: 0.82363623, b: 0.82363623, a: 1}
|
||||
_scoreboardRecordColor2: {r: 0.74499124, g: 0.74499124, b: 0.74499124, a: 1}
|
||||
@ -3125,6 +3661,140 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1763820599}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1811835081
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1811835082}
|
||||
- component: {fileID: 1811835084}
|
||||
- component: {fileID: 1811835083}
|
||||
m_Layer: 5
|
||||
m_Name: 'Num. Username: Score Text (TMP)'
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1811835082
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1811835081}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.99968, y: 0.99968, z: 0.99968}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1092054272}
|
||||
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: -40, y: -20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1811835083
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1811835081}
|
||||
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: '725. Lollex: 178'
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: c3e5b53da86c32731943004a1b8b590e, type: 2}
|
||||
m_sharedMaterial: {fileID: -8174794354313175153, guid: c3e5b53da86c32731943004a1b8b590e, 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: 60.1
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
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 &1811835084
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1811835081}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1827232687
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3680,7 +4350,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -1.0399933, y: 0.5799866}
|
||||
m_AnchoredPosition: {x: -1.0399933, y: 0.5800781}
|
||||
m_SizeDelta: {x: -18.63, y: -20.74}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2024342364
|
||||
@ -3697,10 +4367,10 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Content: {fileID: 1299477820}
|
||||
m_Horizontal: 0
|
||||
m_Vertical: 0
|
||||
m_MovementType: 1
|
||||
m_Vertical: 1
|
||||
m_MovementType: 2
|
||||
m_Elasticity: 0.1
|
||||
m_Inertia: 1
|
||||
m_Inertia: 0
|
||||
m_DecelerationRate: 0.135
|
||||
m_ScrollSensitivity: 1
|
||||
m_Viewport: {fileID: 1022150241}
|
||||
@ -3712,7 +4382,19 @@ MonoBehaviour:
|
||||
m_VerticalScrollbarSpacing: -3
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 2024342364}
|
||||
m_TargetAssemblyTypeName: UnityEngine.UI.ScrollRect, UnityEngine.UI
|
||||
m_MethodName: set_vertical
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &2024342365
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
Binary file not shown.
@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using DatabaseModels.DataTransferObjets;
|
||||
using UnityEngine;
|
||||
|
||||
public class ScoreManager : MonoBehaviour
|
||||
@ -24,7 +26,7 @@ public class ScoreManager : MonoBehaviour
|
||||
PlayerEvents.OnBallTouched += AddScore;
|
||||
PlayerEvents.OnBallTouched += AddExperience;
|
||||
PlayerEvents.OnWallTouched += ResetExperienceAndRewardMultiplier;
|
||||
GameStateManager.Instance.OnGameStateChange += OnGameStateChange;
|
||||
GameStateManager.Instance.OnGameStateChange += async (s) => await OnGameStateChange(s);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
@ -82,7 +84,7 @@ public class ScoreManager : MonoBehaviour
|
||||
_currentMaxExperience = _initialMaxExperience;
|
||||
_previousMaxExperience = 0;
|
||||
|
||||
_uiManager.SetRewardMultiplierText(1);
|
||||
_uiManager.SetRewardMultiplierText(_currentRewardMultiplier);
|
||||
_uiManager.SetExperienceSliderValue(0);
|
||||
_uiManager.SetExperienceSliderMaxValue(_currentMaxExperience);
|
||||
}
|
||||
@ -90,20 +92,28 @@ public class ScoreManager : MonoBehaviour
|
||||
private void ResetAllValues()
|
||||
{
|
||||
_currentScore = 0;
|
||||
_uiManager.SetScoreText(0);
|
||||
_uiManager.SetScoreText(_currentScore);
|
||||
|
||||
ResetExperienceAndRewardMultiplier();
|
||||
}
|
||||
|
||||
private void SaveHighScore()
|
||||
private async Task SaveHighScore()
|
||||
{
|
||||
if (_currentScore < _highScore)
|
||||
if (_currentScore <= _highScore)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_highScore = _currentScore;
|
||||
SessionStore.HighScore = _highScore;
|
||||
|
||||
await HttpClient.Post<ScoreboardRecordDto>(
|
||||
$"{SessionStore.ApiUrl}/scoreboard",
|
||||
new ScoreboardRecordDto
|
||||
{
|
||||
PostTime = DateTime.UtcNow, Score = SessionStore.HighScore,
|
||||
User = SessionStore.UserData.ToDto()
|
||||
});
|
||||
}
|
||||
|
||||
private void LoadHighScore()
|
||||
@ -111,7 +121,7 @@ public class ScoreManager : MonoBehaviour
|
||||
_highScore = SessionStore.HighScore;
|
||||
}
|
||||
|
||||
private void OnGameStateChange(GameState newGameState)
|
||||
private async Task OnGameStateChange(GameState newGameState)
|
||||
{
|
||||
switch (newGameState)
|
||||
{
|
||||
@ -125,7 +135,7 @@ public class ScoreManager : MonoBehaviour
|
||||
case GameState.Game:
|
||||
break;
|
||||
case GameState.GameOver:
|
||||
SaveHighScore();
|
||||
await SaveHighScore();
|
||||
_scoreboardManager.SpawnScoreboardRecords();
|
||||
break;
|
||||
default:
|
||||
|
@ -20,7 +20,7 @@ public class UIManager : MonoBehaviour
|
||||
private float _sliderVelocity;
|
||||
|
||||
[Header("Scoreboard")]
|
||||
[SerializeField] private GameObject _scoreboardScrollViewContent;
|
||||
[SerializeField] private RectTransform _scoreboardScrollViewContent;
|
||||
[SerializeField] private GameObject _scoreboardRecordPrefab;
|
||||
[SerializeField] private Color _scoreboardRecordColor1;
|
||||
[SerializeField] private Color _scoreboardRecordColor2;
|
||||
@ -65,8 +65,8 @@ public class UIManager : MonoBehaviour
|
||||
|
||||
public void InstantiateScoreboardRecords(ScoreboardRecordDto[] records)
|
||||
{
|
||||
var rectTransform = _scoreboardScrollViewContent.GetComponent<RectTransform>();
|
||||
rectTransform.sizeDelta = new Vector2(0, records.Length * 100);
|
||||
_scoreboardScrollViewContent.sizeDelta = new Vector2(0, records.Length * 100);
|
||||
_scoreboardScrollViewContent.localPosition = new Vector3(0, _scoreboardScrollViewContent.sizeDelta.y / records.Length * 2f);
|
||||
|
||||
for (int i = 0; i < records.Length; i++)
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using DatabaseModels.DataTransferObjets;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
@ -9,7 +11,7 @@ public class ScoreboardManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private UIManager _uiManager;
|
||||
|
||||
public void SpawnScoreboardRecords()
|
||||
public async void SpawnScoreboardRecords()
|
||||
{
|
||||
if (SessionStore.UserData == null)
|
||||
{
|
||||
@ -18,32 +20,22 @@ public class ScoreboardManager : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: POST new HighScore to the database
|
||||
|
||||
var filteredScoreboardRecords = GetFilteredScoreboardRecords();
|
||||
var filteredScoreboardRecords = await GetFilteredScoreboardRecords();
|
||||
|
||||
_uiManager.DestroyAllScoreboardRecords();
|
||||
_uiManager.InstantiateScoreboardRecords(filteredScoreboardRecords);
|
||||
|
||||
ScoreboardRecordDto[] GetFilteredScoreboardRecords()
|
||||
async Task<ScoreboardRecordDto[]> GetFilteredScoreboardRecords()
|
||||
{
|
||||
var localRecords = SessionStore.ScoreboardRecords.ToList();
|
||||
var localRecords = await HttpClient.Get<List<ScoreboardRecordDto>>($"{SessionStore.ApiUrl}/scoreboard");
|
||||
var currentUserRecord = localRecords.First(r => r.User.Username == SessionStore.UserData.Username);
|
||||
|
||||
var topUserRecord = localRecords.LastOrDefault(r => r.Score >= SessionStore.HighScore);
|
||||
var topUserPlace = localRecords.IndexOf(topUserRecord) + 1;
|
||||
var filteredRecords = localRecords
|
||||
.SkipWhile(r => Math.Abs(localRecords.IndexOf(r) - localRecords.IndexOf(currentUserRecord)) >= 5)
|
||||
.TakeWhile(r => Math.Abs(localRecords.IndexOf(r) - localRecords.IndexOf(currentUserRecord)) <= 5)
|
||||
.ToArray();
|
||||
|
||||
var currentUserRecord = localRecords.FirstOrDefault(r => r.User.Username == SessionStore.UserData.Username);
|
||||
var currentUserPlace = localRecords.IndexOf(currentUserRecord) != -1 ? localRecords.IndexOf(currentUserRecord) + 1 : -1;
|
||||
|
||||
var startIndex = localRecords.Count - topUserPlace < localRecords.Count - 6 ? topUserPlace - 6 : 0;
|
||||
int count = localRecords.Count - currentUserPlace < localRecords.Count && localRecords.Count - currentUserPlace > 6 ? currentUserPlace + 6 - startIndex : currentUserPlace - startIndex;
|
||||
|
||||
if (currentUserPlace == -1)
|
||||
{
|
||||
count = localRecords.Count - startIndex;
|
||||
}
|
||||
|
||||
return localRecords.GetRange(startIndex, count).ToArray();
|
||||
return filteredRecords.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,13 @@
|
||||
using DatabaseModels.DataTransferObjets;
|
||||
|
||||
public class UserData
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
public UserDto ToDto()
|
||||
{
|
||||
return new UserDto { Id = Id, Username = Username };
|
||||
}
|
||||
}
|
@ -38,6 +38,11 @@ public static class HttpClient
|
||||
await Task.Delay(10);
|
||||
}
|
||||
|
||||
while (!postRequest.downloadHandler.isDone)
|
||||
{
|
||||
await Task.Delay(10);
|
||||
}
|
||||
|
||||
return JsonConvert.DeserializeObject<T>(postRequest.downloadHandler.text);
|
||||
}
|
||||
|
||||
@ -58,7 +63,11 @@ public static class HttpClient
|
||||
|
||||
request.downloadHandler = new DownloadHandlerBuffer();
|
||||
request.SetRequestHeader("Content-Type", "application/json");
|
||||
request.SetRequestHeader("Authorization", $"Bearer {_jwt}");
|
||||
|
||||
if (_jwt != null)
|
||||
{
|
||||
request.SetRequestHeader("Authorization", $"Bearer {_jwt}");
|
||||
}
|
||||
|
||||
request.certificateHandler = new CertificateWhore();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user