Реализована система счетчиков

This commit is contained in:
Сергей Бондарь 2026-05-20 17:36:46 +03:00
parent 4a289dba35
commit ef84b3fa30
13 changed files with 769 additions and 14 deletions

View File

@ -12,3 +12,36 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 206ed6f9eb92df449b9bc2f592f3c5f3, type: 3}
m_Name: CountersConfig
m_EditorClassIdentifier: Assembly-CSharp::CountersConfig
Counters:
- Name: "\u0417\u0430\u043F\u0443\u0441\u043A\u043E\u0432 \u0438\u0437 \u043C\u0435\u043D\u044E"
Type: 0
PrefsKey: StartsFromMenuResettable
Resettable: 1
- Name: "\u0417\u0430\u043F\u0443\u0441\u043A\u043E\u0432 \u0438\u0437 \u043C\u0435\u043D\u044E"
Type: 0
PrefsKey: StartsFromMenu
Resettable: 0
- Name: "\u0417\u0430\u043F\u0443\u0441\u043A\u043E\u0432 \u043F\u043E \u0441\u043A\u0438\u0434\u043A\u0435"
Type: 1
PrefsKey: StartsFromRevengeResettable
Resettable: 1
- Name: "\u0417\u0430\u043F\u0443\u0441\u043A\u043E\u0432 \u043F\u043E \u0441\u043A\u0438\u0434\u043A\u0435"
Type: 1
PrefsKey: StartsFromRevenge
Resettable: 0
- Name: "\u0412\u0441\u0435\u0433\u043E \u0437\u0430\u043F\u0443\u0441\u043A\u043E\u0432"
Type: 2
PrefsKey: TotalStartsResettable
Resettable: 1
- Name: "\u0412\u0441\u0435\u0433\u043E \u0437\u0430\u043F\u0443\u0441\u043A\u043E\u0432"
Type: 0
PrefsKey: TotalStarts
Resettable: 0
- Name: "\u0412\u044B\u0440\u0443\u0447\u043A\u0430"
Type: 3
PrefsKey: RevenueResettable
Resettable: 1
- Name: "\u0412\u044B\u0440\u0443\u0447\u043A\u0430"
Type: 3
PrefsKey: Revenue
Resettable: 0

368
Assets/RecordView.prefab Normal file
View File

@ -0,0 +1,368 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5030930227967751537
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8286065159836260044}
- component: {fileID: 5439178998769437976}
- component: {fileID: 4122186521283273361}
m_Layer: 5
m_Name: Number
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8286065159836260044
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5030930227967751537}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5107459235596224042}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 1, y: 0.5}
--- !u!222 &5439178998769437976
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5030930227967751537}
m_CullTransparentMesh: 1
--- !u!114 &4122186521283273361
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5030930227967751537}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
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: 000000
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: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 4
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5488486956464335744
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5107459235596224042}
- component: {fileID: 6237835960944158840}
- component: {fileID: 553405905926860916}
- component: {fileID: 1794659611774265892}
m_Layer: 5
m_Name: RecordView
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5107459235596224042
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5488486956464335744}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7386617101714834784}
- {fileID: 8286065159836260044}
m_Father: {fileID: 0}
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: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6237835960944158840
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5488486956464335744}
m_CullTransparentMesh: 1
--- !u!114 &553405905926860916
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5488486956464335744}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 0}
m_Color: {r: 0.14901961, g: 0.14901961, b: 0.14901961, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &1794659611774265892
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5488486956464335744}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e8316cb917d3c2941adb9293a82cc494, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::CounterRecordView
_counterNameLabel: {fileID: 5315254988633078493}
_counterAmountLabel: {fileID: 4122186521283273361}
--- !u!1 &8930453305567053038
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7386617101714834784}
- component: {fileID: 3916016807004811352}
- component: {fileID: 5315254988633078493}
m_Layer: 5
m_Name: Name
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7386617101714834784
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8930453305567053038}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5107459235596224042}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 0, y: -0.0000076293945}
m_SizeDelta: {x: 600, y: 50}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &3916016807004811352
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8930453305567053038}
m_CullTransparentMesh: 1
--- !u!114 &5315254988633078493
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8930453305567053038}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
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: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435_\u0441\u0447\u0435\u0442\u0447\u0438\u043A\u0430"
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: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 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}

View File

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

View File

@ -268,6 +268,143 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &570124266
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 570124267}
- component: {fileID: 570124269}
- component: {fileID: 570124268}
m_Layer: 5
m_Name: Title
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &570124267
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 570124266}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1662268745}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -20}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &570124268
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 570124266}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
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: "\u0421\u0447\u0435\u0442\u0447\u0438\u043A\u0438"
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: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 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 &570124269
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 570124266}
m_CullTransparentMesh: 1
--- !u!1 &733623714
GameObject:
m_ObjectHideFlags: 0
@ -815,8 +952,9 @@ GameObject:
- component: {fileID: 1662268745}
- component: {fileID: 1662268747}
- component: {fileID: 1662268746}
- component: {fileID: 1662268748}
m_Layer: 5
m_Name: Image
m_Name: CountersPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -833,13 +971,15 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 570124267}
- {fileID: 1939038420}
m_Father: {fileID: 2124351232}
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: 209.88977, y: -90.802826}
m_SizeDelta: {x: 349.7795, y: 263.6057}
m_AnchoredPosition: {x: 3.415, y: 5.3043}
m_SizeDelta: {x: 1228.0569, y: 817.1112}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1662268746
MonoBehaviour:
@ -854,7 +994,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Color: {r: 0.15471691, g: 0.15471691, b: 0.15471691, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@ -879,6 +1019,83 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1662268744}
m_CullTransparentMesh: 1
--- !u!114 &1662268748
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1662268744}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: de4abf9c590272749af474b35ba4cf1c, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::CountersPanel
_recordViewPrefab: {fileID: 1794659611774265892, guid: d9903a2a1365eed48beb27089a83cc9c, type: 3}
_group: {fileID: 1939038420}
_exitSignal: 1
--- !u!1 &1939038419
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1939038420}
- component: {fileID: 1939038421}
m_Layer: 5
m_Name: group
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1939038420
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1939038419}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1662268745}
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: -81.30939}
m_SizeDelta: {x: -228.7868, y: -162.6188}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1939038421
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1939038419}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.VerticalLayoutGroup
m_Padding:
m_Left: 20
m_Right: 20
m_Top: 20
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 20
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 1
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1 &1983379439
GameObject:
m_ObjectHideFlags: 0

View File

@ -65,7 +65,7 @@ public class MainBootstrap : MonoBehaviour
ComPortController.PaymentReceived += WalletManager.OnCoin;
WalletManager.Initialize(ConfigCatalog.WalletManagerConfig);
CountersSystem.Init(ConfigCatalog.CountersConfig);
GameModesHolder.Initialize(ConfigCatalog.GameModesConfig);
In.Initialize(In.GetInputSourceByType(InputType));

View File

@ -1,7 +1,8 @@
using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "CountersConfig", menuName = "Создание конфигов/Счетчики")]
public class CountersConfig : ScriptableObject
{
public List<CountersSystem.CounterRecord> Counters;
}

View File

@ -1,6 +0,0 @@
using UnityEngine;
public class CountersManager
{
}

View File

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public static class CountersSystem
{
public static List<CounterRecord> Records;
private static bool initialized = false;
public static void Init(CountersConfig config)
{
Records = new();
foreach (var counter in config.Counters)
Records.Add(counter);
Debug.Log("Систкема инициализирована");
initialized = true;
}
public static int GetCount(CounterRecord record) => PlayerPrefs.GetInt(record.PrefsKey, 0);
public static void Add(CounterType counterType, int amount)
{
if(!initialized)
{
Debug.Log("CountersSystem не проинициализирован");
return;
}
var filtred = Records.FindAll(c => c.Type == counterType);
foreach (var rec in filtred)
{
int currentValue = PlayerPrefs.GetInt(rec.PrefsKey, 0);
PlayerPrefs.SetInt(rec.PrefsKey, currentValue + amount);
}
}
public static void Increment(CounterType counterType) => Add(counterType, 1);
public static void Reset()
{
if (!initialized)
{
Debug.Log("CountersSystem не проинициализирован");
return;
}
foreach (var rec in Records)
rec.Reset();
}
[Serializable]
public class CounterRecord
{
public string Name;
public CounterType Type;
public string PrefsKey;
public bool Resettable;
public void Reset()
{
if(Resettable)
PlayerPrefs.SetInt(PrefsKey, 0);
}
}
public enum CounterType
{
StartsFromMenu,
StartsFromRevenge,
TotalStarts,
Revenue
}
}

View File

@ -0,0 +1,16 @@
using TMPro;
using UnityEngine;
public class CounterRecordView : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI _counterNameLabel;
[SerializeField] private TextMeshProUGUI _counterAmountLabel;
public void Configure(CountersSystem.CounterRecord record)
{
_counterNameLabel.text = record.Name;
if (record.Resettable) _counterNameLabel.text += "(обнуляемый)";
_counterAmountLabel.text = CountersSystem.GetCount(record).ToString();
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e8316cb917d3c2941adb9293a82cc494

View File

@ -0,0 +1,43 @@
using System;
using UnityEngine;
public class CountersPanel : MonoBehaviour
{
public event Action OnComplete;
[SerializeField] private CounterRecordView _recordViewPrefab;
[SerializeField] private Transform _group;
[SerializeField] private InSignal _exitSignal = InSignal.UpRight;
private void OnEnable() => Generate();
private void OnDisable() => Clear();
private void OnDestroy() => Clear();
private void Update()
{
if (In.GetButtonDown(_exitSignal)) Exit();
}
private void Generate()
{
foreach (var record in CountersSystem.Records)
{
var go = Instantiate(_recordViewPrefab.gameObject, _group);
go.GetComponent<CounterRecordView>().Configure(record);
}
}
private void Exit()
{
OnComplete?.Invoke();
gameObject.SetActive(false);
}
private void Clear()
{
for (int i = _group.childCount - 1; i >= 0; i++)
{
Destroy(_group.GetChild(i).gameObject);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: de4abf9c590272749af474b35ba4cf1c