From 7f2d9117714c72b2cfc28a572eae17df98e70120 Mon Sep 17 00:00:00 2001 From: sega Date: Fri, 21 Aug 2026 12:21:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9=20=D1=86=D0=B5=D0=BD;=20=D0=9F?= =?UTF-8?q?=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=82=D0=B5=D1=85=D0=BD=D0=B8=D1=87=D0=B5=D1=81=D0=BA?= =?UTF-8?q?=D0=BE=D0=B9=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Оплата и цены/_Группа оплата и цены.asset | 1 + .../Settings/Оплата и цены/ВалютаИмя.asset | 20 +++--- .../Settings/Оплата и цены/Цена Revenge.asset | 2 +- Assets/Prefabs/Balance View.prefab | 10 +-- .../MainMenu/Left group/Technical info.prefab | 69 ++++++++++++++++++- .../Right group/1player mode panel.prefab | 25 +++++-- .../Right group/2player mode panel.prefab | 27 ++++++-- Assets/Scenes/GameScene3D.unity | 16 +++++ Assets/Scripts/Bootstrap.cs | 5 +- Assets/Scripts/Common/CoinCounter.cs | 8 +-- .../Common/PaymentSystem/PaymentSystem.cs | 19 +++++ .../Common/PrizeSystem/PrizeSystemManager.cs | 12 +++- Assets/Scripts/Menu/GamemodePriceLabel.cs | 19 +++++ .../Scripts/Menu/GamemodePriceLabel.cs.meta | 2 + Assets/Scripts/Menu/Technical Info.meta | 8 +++ .../Menu/Technical Info/NumberTechSupport.cs | 25 +++++++ .../Technical Info/NumberTechSupport.cs.meta | 2 + .../Menu/Technical Info/PrizeErrorLabel.cs | 23 +++++++ .../Technical Info/PrizeErrorLabel.cs.meta | 2 + .../Menu/Technical Info/SerialLabel.cs | 14 ++++ .../Menu/Technical Info/SerialLabel.cs.meta | 2 + Assets/Scripts/PluralizeUtil.cs | 44 ++++++++++++ Assets/Scripts/PluralizeUtil.cs.meta | 2 + 23 files changed, 323 insertions(+), 34 deletions(-) create mode 100644 Assets/Scripts/Menu/GamemodePriceLabel.cs create mode 100644 Assets/Scripts/Menu/GamemodePriceLabel.cs.meta create mode 100644 Assets/Scripts/Menu/Technical Info.meta create mode 100644 Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs create mode 100644 Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs.meta create mode 100644 Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs create mode 100644 Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs.meta create mode 100644 Assets/Scripts/Menu/Technical Info/SerialLabel.cs create mode 100644 Assets/Scripts/Menu/Technical Info/SerialLabel.cs.meta create mode 100644 Assets/Scripts/PluralizeUtil.cs create mode 100644 Assets/Scripts/PluralizeUtil.cs.meta diff --git a/Assets/Data/Settings/Оплата и цены/_Группа оплата и цены.asset b/Assets/Data/Settings/Оплата и цены/_Группа оплата и цены.asset index 4346d79..53a394a 100644 --- a/Assets/Data/Settings/Оплата и цены/_Группа оплата и цены.asset +++ b/Assets/Data/Settings/Оплата и цены/_Группа оплата и цены.asset @@ -22,3 +22,4 @@ MonoBehaviour: - {fileID: 11400000, guid: 51ca61689e0784e4baee7d846ffe3562, type: 2} - {fileID: 11400000, guid: 9131639a3e642d44594d8c46d482226d, type: 2} - {fileID: 11400000, guid: 2aff9b9ee8934fb4dbd07b35cb641a4a, type: 2} + - {fileID: 11400000, guid: 108e27e7f6cdbd048a2012ee147c82d9, type: 2} diff --git a/Assets/Data/Settings/Оплата и цены/ВалютаИмя.asset b/Assets/Data/Settings/Оплата и цены/ВалютаИмя.asset index b544a28..25ff85d 100644 --- a/Assets/Data/Settings/Оплата и цены/ВалютаИмя.asset +++ b/Assets/Data/Settings/Оплата и цены/ВалютаИмя.asset @@ -9,24 +9,26 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c97246c0e3a7eff46acd53fd591fb800, type: 3} + m_Script: {fileID: 11500000, guid: 596f85640c2743e4d8be1668d117676b, type: 3} m_Name: "\u0412\u0430\u043B\u044E\u0442\u0430\u0418\u043C\u044F" m_EditorClassIdentifier: Assembly-CSharp::Setting Type: 2 Id: ValutaName Alias: "\u0412\u0430\u043B\u044E\u0442\u0430" - Description: + Description: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0430\u043B\u044E\u0442\u0443, + \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u0443\u044E \u0432 + \u0430\u043F\u043F\u0430\u0440\u0430\u0442\u0435" BoolValue: 0 - IntValue: 1 - IntMin: 1 - IntMax: 10000 - IntStep: 1 + IntValue: 0 + IntMin: 0 + IntMax: 0 + IntStep: 0 FloatValue: 0 FloatMin: 0 FloatMax: 0 FloatStep: 0 - StringValue: "\u0420\u0443\u0431" + StringValue: "\u0440\u0443\u0431\u043B\u0438" AllowedValues: - - "\u0420\u0443\u0431" - - "\u0416\u0435\u0442\u043E\u043D" + - "\u0440\u0443\u0431\u043B\u0438" + - "\u0436\u0435\u0442\u043E\u043D\u044B" SignalValue: diff --git a/Assets/Data/Settings/Оплата и цены/Цена Revenge.asset b/Assets/Data/Settings/Оплата и цены/Цена Revenge.asset index 4dc6670..30d1235 100644 --- a/Assets/Data/Settings/Оплата и цены/Цена Revenge.asset +++ b/Assets/Data/Settings/Оплата и цены/Цена Revenge.asset @@ -14,7 +14,7 @@ MonoBehaviour: m_EditorClassIdentifier: Assembly-CSharp::Setting Type: 0 Id: PriceRevenge - Alias: "\u0426\u0435\u043D\u0430 \u043D\u0430 \u0434\u0432\u043E\u0438\u0445" + Alias: "\u0426\u0435\u043D\u0430 \u0440\u0435\u0432\u0430\u043D\u0448" Description: BoolValue: 0 IntValue: 10 diff --git a/Assets/Prefabs/Balance View.prefab b/Assets/Prefabs/Balance View.prefab index f6964f9..c39bcbf 100644 --- a/Assets/Prefabs/Balance View.prefab +++ b/Assets/Prefabs/Balance View.prefab @@ -332,7 +332,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\u0431\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E" + m_text: "\u0431\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E\n" m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 35bb1c004e5e55c4daaacc21b74e1741, type: 2} m_sharedMaterial: {fileID: 4824725623324572421, guid: 35bb1c004e5e55c4daaacc21b74e1741, type: 2} @@ -362,9 +362,9 @@ MonoBehaviour: m_fontSize: 48 m_fontSizeBase: 48 m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 16 - m_fontSizeMax: 64 + m_enableAutoSizing: 1 + m_fontSizeMin: 6 + m_fontSizeMax: 48 m_fontStyle: 8 m_HorizontalAlignment: 1 m_VerticalAlignment: 512 @@ -376,7 +376,7 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 + m_TextWrappingMode: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} diff --git a/Assets/Prefabs/MainMenu/Left group/Technical info.prefab b/Assets/Prefabs/MainMenu/Left group/Technical info.prefab index ac9dcce..2739334 100644 --- a/Assets/Prefabs/MainMenu/Left group/Technical info.prefab +++ b/Assets/Prefabs/MainMenu/Left group/Technical info.prefab @@ -10,7 +10,9 @@ GameObject: m_Component: - component: {fileID: 2015087922288241712} - component: {fileID: 7226006329329201222} + - component: {fileID: 8208325952977701382} - component: {fileID: 1697470358873887905} + - component: {fileID: 6817565597373667656} m_Layer: 5 m_Name: Error prize m_TagString: Untagged @@ -45,6 +47,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 712505037757843719} m_CullTransparentMesh: 1 +--- !u!114 &8208325952977701382 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 712505037757843719} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9fa18cf31759f4b458f83a315a2a993c, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::PrizeErrorLabel --- !u!114 &1697470358873887905 MonoBehaviour: m_ObjectHideFlags: 0 @@ -138,6 +152,18 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!225 &6817565597373667656 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 712505037757843719} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 --- !u!1 &4345775508834491955 GameObject: m_ObjectHideFlags: 0 @@ -324,6 +350,7 @@ GameObject: m_Component: - component: {fileID: 5350466361621466464} - component: {fileID: 4430333533982892564} + - component: {fileID: 1879940740024692554} - component: {fileID: 2226135250360952902} m_Layer: 5 m_Name: serial @@ -359,6 +386,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6901266747228462016} m_CullTransparentMesh: 1 +--- !u!114 &1879940740024692554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6901266747228462016} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d6c97fab9b8e6b4cb937e54a7cee402, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::SerialLabel --- !u!114 &2226135250360952902 MonoBehaviour: m_ObjectHideFlags: 0 @@ -381,8 +420,8 @@ MonoBehaviour: m_Calls: [] m_text: serialserialserialserialserialserialserial m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} - m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2} + m_fontAsset: {fileID: 11400000, guid: 47e175ba6cb1126439b5583572a406fe, type: 2} + m_sharedMaterial: {fileID: 8312110174854069929, guid: 47e175ba6cb1126439b5583572a406fe, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -461,7 +500,9 @@ GameObject: m_Component: - component: {fileID: 1269013709772846192} - component: {fileID: 3620820917664449704} + - component: {fileID: 8724371996094107436} - component: {fileID: 2510204844322608607} + - component: {fileID: 2272642284648329196} m_Layer: 5 m_Name: Number tech m_TagString: Untagged @@ -496,6 +537,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7386406254193816524} m_CullTransparentMesh: 1 +--- !u!114 &8724371996094107436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7386406254193816524} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3e9f8f60da761914187e747850495340, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::NumberTechSupport --- !u!114 &2510204844322608607 MonoBehaviour: m_ObjectHideFlags: 0 @@ -589,3 +642,15 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!225 &2272642284648329196 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7386406254193816524} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Assets/Prefabs/MainMenu/Right group/1player mode panel.prefab b/Assets/Prefabs/MainMenu/Right group/1player mode panel.prefab index 04523bc..622b859 100644 --- a/Assets/Prefabs/MainMenu/Right group/1player mode panel.prefab +++ b/Assets/Prefabs/MainMenu/Right group/1player mode panel.prefab @@ -10,6 +10,7 @@ GameObject: m_Component: - component: {fileID: 1764844217358391305} - component: {fileID: 4584509035797635186} + - component: {fileID: 4264536733111463199} - component: {fileID: 6026008478200047717} m_Layer: 5 m_Name: PriceLabel @@ -35,7 +36,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} m_AnchoredPosition: {x: 0, y: -4.5999146} - m_SizeDelta: {x: 0.0000076293945, y: 76.58} + m_SizeDelta: {x: -44.03, y: 76.58} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4584509035797635186 CanvasRenderer: @@ -45,6 +46,19 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1299225832892332148} m_CullTransparentMesh: 1 +--- !u!114 &4264536733111463199 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1299225832892332148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b57b82a1d3cc7934399993ee9306ac91, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::GamemodePriceLabel + _gameMode: 0 --- !u!114 &6026008478200047717 MonoBehaviour: m_ObjectHideFlags: 0 @@ -95,9 +109,9 @@ MonoBehaviour: m_fontSize: 68.2 m_fontSizeBase: 68.2 m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 16 - m_fontSizeMax: 64 + m_enableAutoSizing: 1 + m_fontSizeMin: 10 + m_fontSizeMax: 68.2 m_fontStyle: 0 m_HorizontalAlignment: 2 m_VerticalAlignment: 512 @@ -109,7 +123,7 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 + m_TextWrappingMode: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} @@ -566,6 +580,7 @@ MonoBehaviour: characterDuration: 0.15 modeSign: {fileID: 2079392405768567395} signOffset: {x: -25, y: 0} + gameMode: 0 --- !u!1 &6873075656351111007 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/MainMenu/Right group/2player mode panel.prefab b/Assets/Prefabs/MainMenu/Right group/2player mode panel.prefab index 33fe0dc..03cb9a0 100644 --- a/Assets/Prefabs/MainMenu/Right group/2player mode panel.prefab +++ b/Assets/Prefabs/MainMenu/Right group/2player mode panel.prefab @@ -86,6 +86,7 @@ GameObject: m_Component: - component: {fileID: 7906017121606248565} - component: {fileID: 4008223913891029713} + - component: {fileID: 8109155155188360731} - component: {fileID: 1464479260193218143} m_Layer: 5 m_Name: PriceLabel @@ -110,8 +111,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: 8.044975, y: -4.5999146} - m_SizeDelta: {x: -25.01001, y: 76.58} + m_AnchoredPosition: {x: 8.044983, y: -4.5999146} + m_SizeDelta: {x: -38.1, y: 76.58} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4008223913891029713 CanvasRenderer: @@ -121,6 +122,19 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2483619529315147225} m_CullTransparentMesh: 1 +--- !u!114 &8109155155188360731 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2483619529315147225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b57b82a1d3cc7934399993ee9306ac91, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::GamemodePriceLabel + _gameMode: 1 --- !u!114 &1464479260193218143 MonoBehaviour: m_ObjectHideFlags: 0 @@ -171,9 +185,9 @@ MonoBehaviour: m_fontSize: 68.2 m_fontSizeBase: 68.2 m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 16 - m_fontSizeMax: 64 + m_enableAutoSizing: 1 + m_fontSizeMin: 6 + m_fontSizeMax: 68.2 m_fontStyle: 0 m_HorizontalAlignment: 2 m_VerticalAlignment: 512 @@ -185,7 +199,7 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_TextWrappingMode: 1 + m_TextWrappingMode: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} @@ -872,6 +886,7 @@ MonoBehaviour: characterDuration: 0.15 modeSign: {fileID: 3964670502202400011} signOffset: {x: -25, y: 0} + gameMode: 0 --- !u!1 &8339030418053627575 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/GameScene3D.unity b/Assets/Scenes/GameScene3D.unity index 5f3a57d..e51eeb9 100644 --- a/Assets/Scenes/GameScene3D.unity +++ b/Assets/Scenes/GameScene3D.unity @@ -10549,6 +10549,17 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 +--- !u!114 &883715130 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 3244100895163941589, guid: 36522aeb3edb1f14eb882ff35e1a57bd, type: 3} + m_PrefabInstance: {fileID: 5041553860221999073} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d1a7e6eeceb5e5e45a8e6e2e3c243171, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &884967349 GameObject: m_ObjectHideFlags: 0 @@ -16843,6 +16854,7 @@ MonoBehaviour: menu: {fileID: 1122363137} defaultSettings: {fileID: 11400000, guid: b0b04f5868cf5024aa52cb64831e32b9, type: 2} _settingViews: {fileID: 11400000, guid: 8682febe25207ee4688a77bdd8e63fdd, type: 2} + _coinCounter: {fileID: 883715130} --- !u!1 &1400366661 GameObject: m_ObjectHideFlags: 0 @@ -29851,6 +29863,10 @@ PrefabInstance: propertyPath: m_Name value: Right panel objectReference: {fileID: 0} + - target: {fileID: 8607107727081617960, guid: 14e3225697047e04f9fc5a33f4690443, type: 3} + propertyPath: m_text + value: "\u0431\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E" + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] diff --git a/Assets/Scripts/Bootstrap.cs b/Assets/Scripts/Bootstrap.cs index ff53036..9442ee9 100644 --- a/Assets/Scripts/Bootstrap.cs +++ b/Assets/Scripts/Bootstrap.cs @@ -28,7 +28,8 @@ public class Bootstrap : MonoBehaviour [SerializeField] private SettingsScheme defaultSettings; [SerializeField] private SettingViewSet _settingViews; - //[SerializeField] private SettingsScreen _settingsScreen; + + [SerializeField] private CoinCounter _coinCounter; private void Awake() => Initialize(); @@ -76,6 +77,8 @@ public class Bootstrap : MonoBehaviour controlsPerformer.Initialize(); controlsPerformer.SetControlable(menu); + _coinCounter.Initialize(); + Destroy(gameObject); } diff --git a/Assets/Scripts/Common/CoinCounter.cs b/Assets/Scripts/Common/CoinCounter.cs index 071692c..c1a68b4 100644 --- a/Assets/Scripts/Common/CoinCounter.cs +++ b/Assets/Scripts/Common/CoinCounter.cs @@ -7,11 +7,11 @@ public class CoinCounter : MonoBehaviour public CanvasGroup balanceSignGroup; private bool initialized = false; - private void Initialize() + public void Initialize() { UpdateBalanceLabelBySettings(); PaymentSystem.OnBalanceChanged += UpdateBalanceLabel; - SettingsManager.OnSettingsChanged+=UpdateBalanceLabelBySettings; + SettingsManager.OnSettingsChanged += UpdateBalanceLabelBySettings; initialized = true; } @@ -27,7 +27,7 @@ public class CoinCounter : MonoBehaviour private void UpdateBalanceLabelBySettings() { bool freeplay = SettingsManager.GetBool(SettingKey.FREEPLAY); - if(freeplay) + if (freeplay) { balanceLabel.text = "бесплатно"; balanceSignGroup.alpha = 0; @@ -39,5 +39,5 @@ public class CoinCounter : MonoBehaviour } } - public void UpdateBalanceLabel(int newCount) => balanceLabel.text = $"{newCount} {PaymentSystem.ValutaName}"; + public void UpdateBalanceLabel(int newCount) => balanceLabel.text = PaymentSystem.GetPluralizedMoney(newCount); } \ No newline at end of file diff --git a/Assets/Scripts/Common/PaymentSystem/PaymentSystem.cs b/Assets/Scripts/Common/PaymentSystem/PaymentSystem.cs index f84c751..0098e91 100644 --- a/Assets/Scripts/Common/PaymentSystem/PaymentSystem.cs +++ b/Assets/Scripts/Common/PaymentSystem/PaymentSystem.cs @@ -10,6 +10,7 @@ public static class PaymentSystem public static event Action onCoinRemoved; public static event Action OnBalanceChanged; public static event Action OnNotEnoughMoney; + public static event Action OnPaymentDataChanged; public static bool Freeplay { get; private set; } public static int ValutaPerImpulse { get; private set; } @@ -83,12 +84,15 @@ public static class PaymentSystem Freeplay = SettingsManager.GetBool(SettingKey.FREEPLAY); ValutaPerImpulse = PlayerPrefs.GetInt("ValutaPerImpulse", 10); ValutaName = PlayerPrefs.GetString("ValutaName", "руб."); + ValutaName = SettingsManager.GetString(SettingKey.VALUTA_NAME); PricePve = SettingsManager.GetInt(SettingKey.PRICE_PVE); PricePvp = SettingsManager.GetInt(SettingKey.PRICE_PVP); PriceRevenge = SettingsManager.GetInt(SettingKey.PRICE_REVENGE); PulsesCounter = PlayerPrefs.GetInt("PulsesCounter", 0); + + OnPaymentDataChanged?.Invoke(); } private static void ChangeBalance(int delta) @@ -118,4 +122,19 @@ public static class PaymentSystem PulsesCounter = 0; PlayerPrefs.SetInt("PulsesCounter", PulsesCounter); } + + public static string GetPriceString(GameMode mode) + { + if (Freeplay) + { + return "бесплатно"; + } + else + { + int price = mode == GameMode.pve ? PricePve : PricePvp; + return GetPluralizedMoney(price); + } + } + + public static string GetPluralizedMoney(int amount) => $"{amount} {PluralizeUtil.GetValutaPluralized(ValutaName, amount)}"; } \ No newline at end of file diff --git a/Assets/Scripts/Common/PrizeSystem/PrizeSystemManager.cs b/Assets/Scripts/Common/PrizeSystem/PrizeSystemManager.cs index 27e88ce..61450b5 100644 --- a/Assets/Scripts/Common/PrizeSystem/PrizeSystemManager.cs +++ b/Assets/Scripts/Common/PrizeSystem/PrizeSystemManager.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Text; +using UnityEditor.PackageManager; using UnityEngine; @@ -24,6 +25,7 @@ namespace PrizeSystem public static event Action> PrizesChanged; + public static event Action OnErrorStateChanged; private static PrizeSystemManager instance; private static bool prizing = false; @@ -36,6 +38,8 @@ namespace PrizeSystem public static bool HasQrPrizeToGive => qrPrizes.Count > 0; public static bool HasVitrinaPrizeToGive => vitrinaPrizes.Count > 0; + public static bool ErrorState => PlayerPrefs.GetInt(PrefsKeyVault.PRIZING_ERROR_REGISTRED, 0) == 1; + @@ -172,7 +176,7 @@ namespace PrizeSystem } else { - PlayerPrefs.SetInt(PrefsKeyVault.PRIZING_ERROR_REGISTRED, 1); + SetPrizingError(true); SoundManager.instance.playClip(prizeErrorSound); } } @@ -186,6 +190,12 @@ namespace PrizeSystem } + public static void SetPrizingError(bool error) + { + PlayerPrefs.SetInt(PrefsKeyVault.PRIZING_ERROR_REGISTRED, error ? 1 : 0); + OnErrorStateChanged?.Invoke(error); + } + void IncreasePrizeCounters(CountablePrizeType Type) { string prizeCounterKey = Type switch diff --git a/Assets/Scripts/Menu/GamemodePriceLabel.cs b/Assets/Scripts/Menu/GamemodePriceLabel.cs new file mode 100644 index 0000000..d04c3d0 --- /dev/null +++ b/Assets/Scripts/Menu/GamemodePriceLabel.cs @@ -0,0 +1,19 @@ +using TMPro; +using UnityEngine; + +[RequireComponent (typeof(TextMeshProUGUI))] +public class GamemodePriceLabel : MonoBehaviour +{ + [SerializeField] private GameMode _gameMode; + private TextMeshProUGUI _label; + + void Start() + { + _label = GetComponent(); + + UpdatePrice(); + PaymentSystem.OnPaymentDataChanged += UpdatePrice; + } + + private void UpdatePrice() => _label.text = PaymentSystem.GetPriceString(_gameMode); +} diff --git a/Assets/Scripts/Menu/GamemodePriceLabel.cs.meta b/Assets/Scripts/Menu/GamemodePriceLabel.cs.meta new file mode 100644 index 0000000..c087042 --- /dev/null +++ b/Assets/Scripts/Menu/GamemodePriceLabel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b57b82a1d3cc7934399993ee9306ac91 \ No newline at end of file diff --git a/Assets/Scripts/Menu/Technical Info.meta b/Assets/Scripts/Menu/Technical Info.meta new file mode 100644 index 0000000..17c840f --- /dev/null +++ b/Assets/Scripts/Menu/Technical Info.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: faff1e0d4dfedaf41b90fb37545c6adf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs b/Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs new file mode 100644 index 0000000..88efb05 --- /dev/null +++ b/Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs @@ -0,0 +1,25 @@ +using TMPro; +using UnityEngine; + +[RequireComponent(typeof(TextMeshProUGUI), typeof(CanvasGroup))] +public class NumberTechSupport : MonoBehaviour +{ + private CanvasGroup _canvasGroup; + private TextMeshProUGUI _label; + + void Start() + { + _canvasGroup = GetComponent(); + _label = GetComponent(); + + UpdateView(); + SettingsManager.OnSettingsChanged += UpdateView; + } + + private void UpdateView() + { + _canvasGroup.alpha = SettingsManager.GetBool(SettingKey.SHOW_NUMBERTECH) ? 1 : 0; + string number = PlayerPrefs.GetString("NumberTech", "<не указан>"); + _label.text = $"тех. поддержка: {number}"; + } +} diff --git a/Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs.meta b/Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs.meta new file mode 100644 index 0000000..92ad572 --- /dev/null +++ b/Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3e9f8f60da761914187e747850495340 \ No newline at end of file diff --git a/Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs b/Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs new file mode 100644 index 0000000..b06ad4d --- /dev/null +++ b/Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs @@ -0,0 +1,23 @@ +using PrizeSystem; +using UnityEngine; + +[RequireComponent(typeof(CanvasGroup))] +public class PrizeErrorLabel : MonoBehaviour +{ + private CanvasGroup _canvasGroup; + + private bool ShouldDisplay => SettingsManager.GetBool(SettingKey.PRIZING) && SettingsManager.GetBool(SettingKey.DISPLAY_PRIZING_ERROR); + + void Start() + { + _canvasGroup = GetComponent(); + + UpdateView(); + SettingsManager.OnSettingsChanged += UpdateView; + PrizeSystemManager.OnErrorStateChanged += UpdateView; + } + + private void UpdateView() => UpdateView(PrizeSystemManager.ErrorState); + + private void UpdateView(bool error) => _canvasGroup.alpha = ShouldDisplay && error ? 1 : 0; +} \ No newline at end of file diff --git a/Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs.meta b/Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs.meta new file mode 100644 index 0000000..e7adeac --- /dev/null +++ b/Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9fa18cf31759f4b458f83a315a2a993c \ No newline at end of file diff --git a/Assets/Scripts/Menu/Technical Info/SerialLabel.cs b/Assets/Scripts/Menu/Technical Info/SerialLabel.cs new file mode 100644 index 0000000..919458f --- /dev/null +++ b/Assets/Scripts/Menu/Technical Info/SerialLabel.cs @@ -0,0 +1,14 @@ +using TMPro; +using UnityEngine; + +[RequireComponent(typeof(TextMeshProUGUI))] +public class SerialLabel : MonoBehaviour +{ + void Start() + { + var label = GetComponent(); + string serial = PlayerPrefs.GetString(PrefsKeyVault.SERIAL, "<СЕРИЙНЫЙ НОМЕР НЕ УСТАНОВЛЕН>"); + label.text = serial; + Destroy(this); + } +} \ No newline at end of file diff --git a/Assets/Scripts/Menu/Technical Info/SerialLabel.cs.meta b/Assets/Scripts/Menu/Technical Info/SerialLabel.cs.meta new file mode 100644 index 0000000..ab7d0d8 --- /dev/null +++ b/Assets/Scripts/Menu/Technical Info/SerialLabel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0d6c97fab9b8e6b4cb937e54a7cee402 \ No newline at end of file diff --git a/Assets/Scripts/PluralizeUtil.cs b/Assets/Scripts/PluralizeUtil.cs new file mode 100644 index 0000000..7bd3e14 --- /dev/null +++ b/Assets/Scripts/PluralizeUtil.cs @@ -0,0 +1,44 @@ +public static class PluralizeUtil +{ + public static string GetValutaPluralized(string valuta, int amount) + { + switch (valuta) + { + case "рубли": return Rubles(amount); + case "жетоны": return Tokens(amount); + default: return "Valuta_Error"; + } + } + + private static string Rubles(int n) + { + int lastDigit = n % 10; + int lastTwoDigits = n % 100; + + if (lastTwoDigits >= 11 && lastTwoDigits <= 14) + return "рублей"; + + return lastDigit switch + { + 1 => "рубль", + 2 or 3 or 4 => "рубля", + _ => "рублей" + }; + } + + private static string Tokens(int n) + { + int lastDigit = n % 10; + int lastTwoDigits = n % 100; + + if (lastTwoDigits >= 11 && lastTwoDigits <= 14) + return "жетонов"; + + return lastDigit switch + { + 1 => "жетон", + 2 or 3 or 4 => "жетона", + _ => "жетонов" + }; + } +} \ No newline at end of file diff --git a/Assets/Scripts/PluralizeUtil.cs.meta b/Assets/Scripts/PluralizeUtil.cs.meta new file mode 100644 index 0000000..51f699e --- /dev/null +++ b/Assets/Scripts/PluralizeUtil.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e2cecab94a83a05459c31d859525dd1a \ No newline at end of file