add instantiatiating scoreboard-record objects to UI
This commit is contained in:
parent
e82482d996
commit
e866893a96
572
Assets/Scenes/SampleScene.unity
generated
572
Assets/Scenes/SampleScene.unity
generated
@ -319,190 +319,6 @@ BoxCollider2D:
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 100, y: 3000}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &120197422
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 120197423}
|
||||
- component: {fileID: 120197425}
|
||||
- component: {fileID: 120197424}
|
||||
- component: {fileID: 120197426}
|
||||
m_Layer: 5
|
||||
m_Name: Handle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &120197423
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 120197422}
|
||||
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: 569398266}
|
||||
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: 20, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &120197424
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 120197422}
|
||||
m_Enabled: 0
|
||||
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 &120197425
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 120197422}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &120197426
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 120197422}
|
||||
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!1 &154570516
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 154570517}
|
||||
- component: {fileID: 154570519}
|
||||
- component: {fileID: 154570518}
|
||||
- component: {fileID: 154570520}
|
||||
m_Layer: 5
|
||||
m_Name: Handle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &154570517
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 154570516}
|
||||
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: 1059141580}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.20563883}
|
||||
m_AnchorMax: {x: 1, y: 0.9999998}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 20, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &154570518
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 154570516}
|
||||
m_Enabled: 0
|
||||
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 &154570519
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 154570516}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &154570520
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 154570516}
|
||||
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!1 &221840722
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -582,6 +398,7 @@ MonoBehaviour:
|
||||
_maxRewardMultiplier: 128
|
||||
_initialMaxExperience: 3
|
||||
_uiManager: {fileID: 1676064789}
|
||||
_scoreboardManager: {fileID: 369982994}
|
||||
--- !u!1 &333766462
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -780,10 +597,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2bc38f67863847dabfe33b36efc70de6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_scoreboardRecordPrefab: {fileID: 7150267415123359698, guid: 17475f0c207c8230da0daf9725875171, type: 3}
|
||||
_color1: {r: 0.82363623, g: 0.82363623, b: 0.82363623, a: 1}
|
||||
_color2: {r: 0.74499124, g: 0.74499124, b: 0.74499124, a: 1}
|
||||
_scrollViewContent: {fileID: 1299477819}
|
||||
_uiManager: {fileID: 1676064789}
|
||||
--- !u!1 &394578615
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1374,42 +1188,6 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!1 &569398265
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 569398266}
|
||||
m_Layer: 5
|
||||
m_Name: Sliding Area
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &569398266
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 569398265}
|
||||
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: 120197423}
|
||||
m_Father: {fileID: 1486101994}
|
||||
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: -20, y: -20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &624579872
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2046,149 +1824,6 @@ SpriteRenderer:
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &1005368180
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1005368181}
|
||||
- component: {fileID: 1005368184}
|
||||
- component: {fileID: 1005368183}
|
||||
- component: {fileID: 1005368182}
|
||||
- component: {fileID: 1005368185}
|
||||
m_Layer: 5
|
||||
m_Name: Scrollbar Vertical
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1005368181
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1005368180}
|
||||
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: 1059141580}
|
||||
m_Father: {fileID: 2024342363}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 20, y: -17}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!114 &1005368182
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1005368180}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, 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: 154570518}
|
||||
m_HandleRect: {fileID: 154570517}
|
||||
m_Direction: 2
|
||||
m_Value: 0.9999991
|
||||
m_Size: 0.794361
|
||||
m_NumberOfSteps: 0
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &1005368183
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1005368180}
|
||||
m_Enabled: 0
|
||||
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: 10907, 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 &1005368184
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1005368180}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1005368185
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1005368180}
|
||||
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!1 &1022150240
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2226,7 +1861,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -17, y: -17}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &1022150242
|
||||
MonoBehaviour:
|
||||
@ -2589,42 +2224,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1041961125}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1059141579
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1059141580}
|
||||
m_Layer: 5
|
||||
m_Name: Sliding Area
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1059141580
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1059141579}
|
||||
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: 154570517}
|
||||
m_Father: {fileID: 1005368181}
|
||||
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: -20, y: -20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &1064798217
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3057,8 +2656,8 @@ RectTransform:
|
||||
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.00008440938}
|
||||
m_SizeDelta: {x: 0, y: 658.63}
|
||||
m_AnchoredPosition: {x: 0, y: -0.00022219129}
|
||||
m_SizeDelta: {x: 0, y: 523.19}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!1 &1457871091
|
||||
GameObject:
|
||||
@ -3254,149 +2853,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1483431852}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1486101993
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1486101994}
|
||||
- component: {fileID: 1486101997}
|
||||
- component: {fileID: 1486101996}
|
||||
- component: {fileID: 1486101995}
|
||||
- component: {fileID: 1486101998}
|
||||
m_Layer: 5
|
||||
m_Name: Scrollbar Horizontal
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1486101994
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1486101993}
|
||||
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: 569398266}
|
||||
m_Father: {fileID: 2024342363}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -17, y: 20}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!114 &1486101995
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1486101993}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, 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: 120197424}
|
||||
m_HandleRect: {fileID: 120197423}
|
||||
m_Direction: 0
|
||||
m_Value: 0
|
||||
m_Size: 1
|
||||
m_NumberOfSteps: 0
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &1486101996
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1486101993}
|
||||
m_Enabled: 0
|
||||
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: 10907, 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 &1486101997
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1486101993}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1486101998
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1486101993}
|
||||
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!1 &1542726290
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3568,6 +3024,10 @@ MonoBehaviour:
|
||||
_rewardMultiplierText: {fileID: 1114100292}
|
||||
_experienceSlider: {fileID: 2325626163454522012}
|
||||
_sliderSmoothTime: 0.1
|
||||
_scoreboardScrollViewContent: {fileID: 1299477819}
|
||||
_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}
|
||||
--- !u!1 &1763820599
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4133,7 +3593,7 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 60.85
|
||||
m_fontSize: 60.1
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
@ -4215,15 +3675,13 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1022150241}
|
||||
- {fileID: 1486101994}
|
||||
- {fileID: 1005368181}
|
||||
m_Father: {fileID: 1763820600}
|
||||
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: 9.880005, y: 0.5799866}
|
||||
m_SizeDelta: {x: 3.21, y: -20.74}
|
||||
m_AnchoredPosition: {x: -1.0399933, y: 0.5799866}
|
||||
m_SizeDelta: {x: -18.63, y: -20.74}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2024342364
|
||||
MonoBehaviour:
|
||||
@ -4239,15 +3697,15 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Content: {fileID: 1299477820}
|
||||
m_Horizontal: 0
|
||||
m_Vertical: 1
|
||||
m_Vertical: 0
|
||||
m_MovementType: 1
|
||||
m_Elasticity: 0.1
|
||||
m_Inertia: 1
|
||||
m_DecelerationRate: 0.135
|
||||
m_ScrollSensitivity: 1
|
||||
m_Viewport: {fileID: 1022150241}
|
||||
m_HorizontalScrollbar: {fileID: 1486101995}
|
||||
m_VerticalScrollbar: {fileID: 1005368182}
|
||||
m_HorizontalScrollbar: {fileID: 0}
|
||||
m_VerticalScrollbar: {fileID: 0}
|
||||
m_HorizontalScrollbarVisibility: 2
|
||||
m_VerticalScrollbarVisibility: 2
|
||||
m_HorizontalScrollbarSpacing: -3
|
||||
|
@ -3,7 +3,8 @@ using UnityEngine.Serialization;
|
||||
|
||||
public class GameStateController : MonoBehaviour
|
||||
{
|
||||
[FormerlySerializedAs("ChangeToState")] [Tooltip("Selected state will be applied when the game starts or on the button press")]
|
||||
[FormerlySerializedAs("ChangeToState")]
|
||||
[Tooltip("Selected state will be applied when the game starts or on the button press")]
|
||||
public GameState changeToState;
|
||||
|
||||
private void Start()
|
||||
|
@ -121,12 +121,12 @@ public class ScoreManager : MonoBehaviour
|
||||
break;
|
||||
case GameState.PreGame:
|
||||
ResetAllValues();
|
||||
_scoreboardManager.SpawnScoreboardRecords();
|
||||
break;
|
||||
case GameState.Game:
|
||||
break;
|
||||
case GameState.GameOver:
|
||||
SaveHighScore();
|
||||
_scoreboardManager.SpawnScoreboardRecords();
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(newGameState), newGameState, null);
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using DatabaseModels.DataTransferObjets;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@ -17,6 +18,13 @@ public class UIManager : MonoBehaviour
|
||||
[SerializeField] private Slider _experienceSlider;
|
||||
[SerializeField] private float _sliderSmoothTime;
|
||||
private float _sliderVelocity;
|
||||
|
||||
[Header("Scoreboard")]
|
||||
[SerializeField] private GameObject _scoreboardScrollViewContent;
|
||||
[SerializeField] private GameObject _scoreboardRecordPrefab;
|
||||
[SerializeField] private Color _scoreboardRecordColor1;
|
||||
[SerializeField] private Color _scoreboardRecordColor2;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@ -54,6 +62,28 @@ public class UIManager : MonoBehaviour
|
||||
|
||||
isFull = Math.Abs(_experienceSlider.value - _experienceSlider.maxValue) < 0.1f;
|
||||
}
|
||||
|
||||
public void InstantiateScoreboardRecords(ScoreboardRecordDto[] records)
|
||||
{
|
||||
var rectTransform = _scoreboardScrollViewContent.GetComponent<RectTransform>();
|
||||
rectTransform.sizeDelta = new Vector2(0, records.Length * 100);
|
||||
|
||||
for (int i = 0; i < records.Length; i++)
|
||||
{
|
||||
var record = Instantiate(_scoreboardRecordPrefab, Vector3.zero, Quaternion.identity, _scoreboardScrollViewContent.transform);
|
||||
record.GetComponent<RectTransform>().localPosition = new Vector2(218, -50 - 100 * i);
|
||||
record.GetComponent<Image>().color = i % 2 == 0 ? _scoreboardRecordColor1 : _scoreboardRecordColor2;
|
||||
record.GetComponentInChildren<TextMeshProUGUI>().text = $"{i + 1}. {records[i].User.Username}: {records[i].Score}";
|
||||
}
|
||||
}
|
||||
|
||||
public void DestroyAllScoreboardRecords()
|
||||
{
|
||||
for (int i = 0; i < _scoreboardScrollViewContent.transform.childCount; i++)
|
||||
{
|
||||
Destroy(_scoreboardScrollViewContent.transform.GetChild(i).gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnGameStateChange(GameState newGameState)
|
||||
{
|
||||
|
@ -1,33 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using DatabaseModels.DataTransferObjets;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ScoreboardManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject _scoreboardRecordPrefab;
|
||||
|
||||
[SerializeField] private Color _color1;
|
||||
[SerializeField] private Color _color2;
|
||||
|
||||
[SerializeField] private GameObject _scrollViewContent;
|
||||
[SerializeField] private UIManager _uiManager;
|
||||
|
||||
public void SpawnScoreboardRecords()
|
||||
{
|
||||
if (SessionStore.UserData == null)
|
||||
{
|
||||
// Login to display online scoreboard
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: POST new HighScore to the database
|
||||
|
||||
var filteredScoreboardRecords = GetFilteredScoreboardRecords();
|
||||
|
||||
var rectTransform = _scrollViewContent.GetComponent<RectTransform>();
|
||||
rectTransform.sizeDelta = new Vector2(0, filteredScoreboardRecords.Length * 100);
|
||||
|
||||
for (int i = 0; i < _scrollViewContent.transform.childCount; i++)
|
||||
{
|
||||
Destroy(_scrollViewContent.transform.GetChild(i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < filteredScoreboardRecords.Length; i++)
|
||||
{
|
||||
Instantiate(_scoreboardRecordPrefab, new Vector2(225, -50 - 100 * i), Quaternion.identity, _scrollViewContent.transform);
|
||||
}
|
||||
_uiManager.DestroyAllScoreboardRecords();
|
||||
_uiManager.InstantiateScoreboardRecords(filteredScoreboardRecords);
|
||||
|
||||
ScoreboardRecordDto[] GetFilteredScoreboardRecords()
|
||||
{
|
||||
@ -39,8 +35,8 @@ public class ScoreboardManager : MonoBehaviour
|
||||
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 - 5 ? topUserPlace - 5 : 0;
|
||||
int count = localRecords.Count - currentUserPlace < localRecords.Count && localRecords.Count - currentUserPlace > 3 ? currentUserPlace + 3 - startIndex : currentUserPlace - startIndex;
|
||||
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user