Подключение отображений цен; Подключение отображения технической информации
This commit is contained in:
parent
d284694456
commit
7f2d911771
@ -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}
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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: []
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -10,6 +10,7 @@ public static class PaymentSystem
|
||||
public static event Action<int> onCoinRemoved;
|
||||
public static event Action<int> 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)}";
|
||||
}
|
||||
@ -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<List<Prize>> PrizesChanged;
|
||||
public static event Action<bool> 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
|
||||
|
||||
19
Assets/Scripts/Menu/GamemodePriceLabel.cs
Normal file
19
Assets/Scripts/Menu/GamemodePriceLabel.cs
Normal file
@ -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<TextMeshProUGUI>();
|
||||
|
||||
UpdatePrice();
|
||||
PaymentSystem.OnPaymentDataChanged += UpdatePrice;
|
||||
}
|
||||
|
||||
private void UpdatePrice() => _label.text = PaymentSystem.GetPriceString(_gameMode);
|
||||
}
|
||||
2
Assets/Scripts/Menu/GamemodePriceLabel.cs.meta
Normal file
2
Assets/Scripts/Menu/GamemodePriceLabel.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b57b82a1d3cc7934399993ee9306ac91
|
||||
8
Assets/Scripts/Menu/Technical Info.meta
Normal file
8
Assets/Scripts/Menu/Technical Info.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: faff1e0d4dfedaf41b90fb37545c6adf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
25
Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs
Normal file
25
Assets/Scripts/Menu/Technical Info/NumberTechSupport.cs
Normal file
@ -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<CanvasGroup>();
|
||||
_label = GetComponent<TextMeshProUGUI>();
|
||||
|
||||
UpdateView();
|
||||
SettingsManager.OnSettingsChanged += UpdateView;
|
||||
}
|
||||
|
||||
private void UpdateView()
|
||||
{
|
||||
_canvasGroup.alpha = SettingsManager.GetBool(SettingKey.SHOW_NUMBERTECH) ? 1 : 0;
|
||||
string number = PlayerPrefs.GetString("NumberTech", "<не указан>");
|
||||
_label.text = $"тех. поддержка: {number}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e9f8f60da761914187e747850495340
|
||||
23
Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs
Normal file
23
Assets/Scripts/Menu/Technical Info/PrizeErrorLabel.cs
Normal file
@ -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<CanvasGroup>();
|
||||
|
||||
UpdateView();
|
||||
SettingsManager.OnSettingsChanged += UpdateView;
|
||||
PrizeSystemManager.OnErrorStateChanged += UpdateView;
|
||||
}
|
||||
|
||||
private void UpdateView() => UpdateView(PrizeSystemManager.ErrorState);
|
||||
|
||||
private void UpdateView(bool error) => _canvasGroup.alpha = ShouldDisplay && error ? 1 : 0;
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fa18cf31759f4b458f83a315a2a993c
|
||||
14
Assets/Scripts/Menu/Technical Info/SerialLabel.cs
Normal file
14
Assets/Scripts/Menu/Technical Info/SerialLabel.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(TextMeshProUGUI))]
|
||||
public class SerialLabel : MonoBehaviour
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
var label = GetComponent<TextMeshProUGUI>();
|
||||
string serial = PlayerPrefs.GetString(PrefsKeyVault.SERIAL, "<СЕРИЙНЫЙ НОМЕР НЕ УСТАНОВЛЕН>");
|
||||
label.text = serial;
|
||||
Destroy(this);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Menu/Technical Info/SerialLabel.cs.meta
Normal file
2
Assets/Scripts/Menu/Technical Info/SerialLabel.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d6c97fab9b8e6b4cb937e54a7cee402
|
||||
44
Assets/Scripts/PluralizeUtil.cs
Normal file
44
Assets/Scripts/PluralizeUtil.cs
Normal file
@ -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 => "жетона",
|
||||
_ => "жетонов"
|
||||
};
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/PluralizeUtil.cs.meta
Normal file
2
Assets/Scripts/PluralizeUtil.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2cecab94a83a05459c31d859525dd1a
|
||||
Loading…
x
Reference in New Issue
Block a user