Отдельные счетчики для каждого типа приза. Счетчик кассы справа добавлено название валюты.
This commit is contained in:
parent
3fd5c1a8ef
commit
503d59fcc2
@ -11349,7 +11349,7 @@ Material:
|
||||
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
|
||||
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _GlowColor: {r: 0.79440284, g: 1, b: 0, a: 1}
|
||||
- _GlowColor: {r: 0.3309754, g: 1, b: 0, a: 1}
|
||||
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
|
||||
- _OutlineColor: {r: 0.554717, g: 0.554717, b: 0.554717, a: 1}
|
||||
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
||||
@ -447,7 +447,7 @@ GameObject:
|
||||
- component: {fileID: 19565849}
|
||||
- component: {fileID: 19565851}
|
||||
m_Layer: 5
|
||||
m_Name: StartsNullable
|
||||
m_Name: CashNullable
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@ -469,7 +469,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 20, y: -124}
|
||||
m_AnchoredPosition: {x: 20, y: -148}
|
||||
m_SizeDelta: {x: 809.9999, y: 24}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &19565849
|
||||
@ -5637,7 +5637,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0427b50b8b84b5641a0188046aaee227, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
dummyBots: 0
|
||||
dummyBots: 1
|
||||
botsAmount: 5
|
||||
dummyPreset: {fileID: 11400000, guid: 35ba7f84d7557e8479f7f086269256f6, type: 2}
|
||||
MistressPreset: {fileID: 11400000, guid: 9aec48759dff81140a8ede5cbefe07d5, type: 2}
|
||||
@ -7964,6 +7964,162 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 422852723}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &423618865
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 423618866}
|
||||
- component: {fileID: 423618869}
|
||||
- component: {fileID: 423618868}
|
||||
- component: {fileID: 423618867}
|
||||
m_Layer: 5
|
||||
m_Name: Prizes.1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &423618866
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 423618865}
|
||||
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: 626053254}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 20, y: -52}
|
||||
m_SizeDelta: {x: 809.9999, y: 24}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &423618867
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 423618865}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreLayout: 0
|
||||
m_MinWidth: -1
|
||||
m_MinHeight: -1
|
||||
m_PreferredWidth: -1
|
||||
m_PreferredHeight: -1
|
||||
m_FlexibleWidth: -1
|
||||
m_FlexibleHeight: -1
|
||||
m_LayoutPriority: 1
|
||||
--- !u!114 &423618868
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 423618865}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: "\u0425-\u0445\u043E\u043F\u043F\u0435\u0440; \u0422-\u0442\u0438\u043A\u0435\u0442\u043D\u0438\u043A;
|
||||
\u041C-\u043C\u0430\u0440\u0431\u043B\u0441; \u0421-\u0441\u0443\u043F\u0435\u0440\u043F\u0440\u0438\u0437"
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2}
|
||||
m_sharedMaterial: {fileID: 4262305343556741190, guid: 3f10bbcf486189d4f95b8de6dc2e2177, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967040
|
||||
m_fontColor: {r: 0, 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: 20
|
||||
m_fontSizeBase: 20
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!222 &423618869
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 423618865}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &426391026
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -13432,6 +13588,7 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 26183544}
|
||||
- {fileID: 423618866}
|
||||
- {fileID: 1764998038}
|
||||
- {fileID: 1165451720}
|
||||
- {fileID: 1140329772}
|
||||
@ -33162,7 +33319,7 @@ GameObject:
|
||||
- component: {fileID: 1140329773}
|
||||
- component: {fileID: 1140329775}
|
||||
m_Layer: 5
|
||||
m_Name: Starts
|
||||
m_Name: Cash
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@ -33184,7 +33341,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 20, y: -100}
|
||||
m_AnchoredPosition: {x: 20, y: -124}
|
||||
m_SizeDelta: {x: 809.9999, y: 24}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &1140329773
|
||||
@ -33415,7 +33572,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 20, y: -76}
|
||||
m_AnchoredPosition: {x: 20, y: -100}
|
||||
m_SizeDelta: {x: 809.9999, y: 24}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &1165451721
|
||||
@ -46238,7 +46395,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 20, y: -148}
|
||||
m_AnchoredPosition: {x: 20, y: -172}
|
||||
m_SizeDelta: {x: 809.9999, y: 24}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &1602294396
|
||||
@ -48745,7 +48902,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 20, y: -52}
|
||||
m_AnchoredPosition: {x: 20, y: -76}
|
||||
m_SizeDelta: {x: 809.9999, y: 24}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &1764998039
|
||||
|
||||
@ -32,23 +32,23 @@ public class SettingsActions : MonoBehaviour
|
||||
}
|
||||
public void ResetPrizes()
|
||||
{
|
||||
PlayerPrefs.SetInt(PrizeSystem.key_prizesgivenNul, 0);
|
||||
PrizeSystem.ResetPrizeCounters();
|
||||
RefreshUI();
|
||||
}
|
||||
|
||||
|
||||
//Панель1
|
||||
public void EnterSpecialPrize() => gm.stateMachine.ChangeState(new EnterSpecialPrizeState());
|
||||
public void EnterPvePrice() => gm.stateMachine.ChangeState(new EnterPricePVEState());
|
||||
public void EnterPveRevengePrice() => gm.stateMachine.ChangeState(new EnterPricePVERevengeState());
|
||||
public void EnterPvpPrice() => gm.stateMachine.ChangeState(new EnterPricePVPState());
|
||||
public void EnterSupportNumber() => gm.stateMachine.ChangeState(new GetNumberState());
|
||||
public void EnterPrizesAvailable() => gm.stateMachine.ChangeState(new EnterPrizesAvailableState());
|
||||
public void ResetPrizeError() => PlayerPrefs.SetInt(KeyVault.PRIZING_ERROR_REGISTRED, 0);
|
||||
public void EnterPrizesSettings() => gm.stateMachine.ChangeState(new EnterPrizesAvailableState());
|
||||
public void ConfigurePrizes() => gm.stateMachine.ChangeState(new EnterPrizesForCharactersState());
|
||||
public void EnterSpecialPrize() => gm.stateMachine.ChangeState(new EnterSpecialPrizeState());
|
||||
public void EnterPvePrice() => gm.stateMachine.ChangeState(new EnterPricePVEState());
|
||||
public void EnterPveRevengePrice() => gm.stateMachine.ChangeState(new EnterPricePVERevengeState());
|
||||
public void EnterPvpPrice() => gm.stateMachine.ChangeState(new EnterPricePVPState());
|
||||
public void EnterSupportNumber() => gm.stateMachine.ChangeState(new GetNumberState());
|
||||
public void EnterPrizesAvailable() => gm.stateMachine.ChangeState(new EnterPrizesAvailableState());
|
||||
public void ResetPrizeError() => PlayerPrefs.SetInt(KeyVault.PRIZING_ERROR_REGISTRED, 0);
|
||||
public void EnterPrizesSettings() => gm.stateMachine.ChangeState(new EnterPrizesAvailableState());
|
||||
public void ConfigurePrizes() => gm.stateMachine.ChangeState(new EnterPrizesForCharactersState());
|
||||
public void ConfigurePulsesToResetDifficulty() => gm.stateMachine.ChangeState(new EnterPulsesToResetDifficulty());
|
||||
public void ConfigureValutaPerPulse() => gm.stateMachine.ChangeState(new EnterValutaPerImpulse());
|
||||
public void EnterValutaName() => gm.stateMachine.ChangeState(new EnterValutaNameState());
|
||||
public void EnterValutaName() => gm.stateMachine.ChangeState(new EnterValutaNameState());
|
||||
|
||||
//Панель2
|
||||
public void EnterIO_test() => gm.stateMachine.ChangeState(new IoTestState(IO_test));
|
||||
@ -75,11 +75,15 @@ public class SettingsActions : MonoBehaviour
|
||||
public TextMeshProUGUI starts, startsNul, prize, prizeNul;
|
||||
void RefreshUI()
|
||||
{
|
||||
starts.text = STARTS_BASE + UNNULLABLE + ": " + PlayerPrefs.GetInt(PrizeSystem.key_starts);
|
||||
startsNul.text = STARTS_BASE + NULLABLE + ": " + PlayerPrefs.GetInt(PrizeSystem.key_startsNul);
|
||||
string valutaName = PlayerPrefs.GetString("ValutaName", "руб.");
|
||||
|
||||
prize.text = PRIZE_BASE + UNNULLABLE + ": " + PlayerPrefs.GetInt(PrizeSystem.key_prizesgiven);
|
||||
prizeNul.text = PRIZE_BASE + NULLABLE + ": " + PlayerPrefs.GetInt(PrizeSystem.key_prizesgivenNul);
|
||||
starts.text = STARTS_BASE + UNNULLABLE + ": " + PlayerPrefs.GetInt(PrizeSystem.key_starts) + " " + valutaName;
|
||||
startsNul.text = STARTS_BASE + NULLABLE + ": " + PlayerPrefs.GetInt(PrizeSystem.key_startsNul) + " " + valutaName;
|
||||
|
||||
//prize.text = PRIZE_BASE + UNNULLABLE + ": " + PlayerPrefs.GetInt(PrizeSystem.key_prizesgiven);
|
||||
//prizeNul.text = PRIZE_BASE + NULLABLE + ": " + PlayerPrefs.GetInt(PrizeSystem.key_prizesgivenNul);
|
||||
prize.text = PRIZE_BASE + UNNULLABLE + ": " + PrizeSystem.GetPrizesCounterString();
|
||||
prizeNul.text = PRIZE_BASE + NULLABLE + ": " + PrizeSystem.GetPrizesCounterNullableString();
|
||||
}
|
||||
|
||||
void RefreshUI(int a) => RefreshUI();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
@ -15,21 +16,16 @@ public class PrizeSystem : MonoBehaviour
|
||||
public static string key_prizesgiven = "PRIZESGIVEN";
|
||||
public static string key_prizesgivenNul = "PRIZESGIVENNUL";
|
||||
|
||||
public static string HopperPrizeCounter = "HopperCounter";
|
||||
public static string MarblesPrizeCounter = "MarblesCounter";
|
||||
public static string TicketPrizeCounter = "TicketCounter";
|
||||
public static string SpecialPrizeCounter = "SpecialCounter";
|
||||
|
||||
|
||||
private static PrizeSystem instance;
|
||||
private static Coroutine prizeCoroutine;
|
||||
private static bool prizing = false;
|
||||
|
||||
//===========================start: PUBLIC API===========================//
|
||||
/// <summary>
|
||||
/// Инициализирует систему призов и счетчики статистики.
|
||||
/// Должен быть вызван один раз при запуске приложения.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Выполняет:
|
||||
/// - Установку статического экземпляра (singleton)
|
||||
/// - Инициализацию счетчиков в PlayerPrefs если они отсутствуют
|
||||
/// - Подготовку системы к работе
|
||||
/// </remarks>
|
||||
public void Initialize()
|
||||
{
|
||||
instance = this;
|
||||
@ -53,36 +49,23 @@ public class PrizeSystem : MonoBehaviour
|
||||
Debug.Log("Пустой приз. Возврат.");
|
||||
return;
|
||||
}
|
||||
if (prizeType == PrizeType.Hopper)
|
||||
else if (prizeType == PrizeType.Special)
|
||||
{
|
||||
Debug.Log($"Хоппер в количестве {prize.Amount}");
|
||||
instance.StartCoroutine(instance.HopperPrize(prize.Amount));
|
||||
}
|
||||
if (prizeType == PrizeType.Hopper2)
|
||||
{
|
||||
Debug.Log($"Хоппер2 в количестве {prize.Amount}");
|
||||
instance.StartCoroutine(instance.HopperPrize(prize.Amount));//ТУТ БУДЕТ АЛГОРИТМ ДЛЯ 2 ХОППЕРА
|
||||
}
|
||||
if (prizeType == PrizeType.Special)
|
||||
{
|
||||
//GameManager.instance.stateMachine.ChangeState(new PrizeState());
|
||||
PlayerPrefs.SetInt("NeedSpecialPrize", 1);
|
||||
}
|
||||
if (prizeType == PrizeType.Ticket)
|
||||
else
|
||||
{
|
||||
instance.StartCoroutine(instance.HopperPrize(prize.Amount));
|
||||
}
|
||||
if (prizeType == PrizeType.Marbles)
|
||||
{
|
||||
instance.StartCoroutine(instance.HopperPrize(prize.Amount));
|
||||
instance.StartCoroutine(instance.PrizingProcess(prize.Amount, prizeType));
|
||||
}
|
||||
}
|
||||
|
||||
//===========================end: PUBLIC API===========================//
|
||||
|
||||
#region Приватные методы
|
||||
private IEnumerator HopperPrize(int amount)
|
||||
private IEnumerator PrizingProcess(int amount, PrizeType Type)
|
||||
{
|
||||
Debug.Log($"Выдача приза {Type}. Количество: {amount}");
|
||||
prizing = true;
|
||||
for (int i = 0; i < amount; i++)
|
||||
{
|
||||
bool noPrizWhenError = SettingsManager.GetBool("PrizingWhenError", true);
|
||||
@ -90,7 +73,6 @@ public class PrizeSystem : MonoBehaviour
|
||||
|
||||
if (errorRegistred && noPrizWhenError) yield break;
|
||||
|
||||
prizing = true;
|
||||
|
||||
float timeout = 10; //сек
|
||||
Debug.Log("Начинаю выдачу 303");
|
||||
@ -106,7 +88,7 @@ public class PrizeSystem : MonoBehaviour
|
||||
{
|
||||
Debug.Log("Считан приз");
|
||||
success = true;
|
||||
IncreasePrizeCounters();
|
||||
|
||||
break;
|
||||
}
|
||||
yield return null;
|
||||
@ -120,9 +102,14 @@ public class PrizeSystem : MonoBehaviour
|
||||
|
||||
if (success)
|
||||
{
|
||||
//контроль остатков
|
||||
int prizesCount = PlayerPrefs.GetInt(KeyVault.PRIZES_AVAILABLE);
|
||||
prizesCount = Mathf.Clamp(prizesCount - 1, 0, 9999);
|
||||
PlayerPrefs.SetInt(KeyVault.PRIZES_AVAILABLE, prizesCount);
|
||||
|
||||
//Счетчики
|
||||
IncreasePrizeCounters(Type);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -133,17 +120,62 @@ public class PrizeSystem : MonoBehaviour
|
||||
}
|
||||
|
||||
|
||||
void IncreasePrizeCounters()
|
||||
void IncreasePrizeCounters(PrizeType Type)
|
||||
{
|
||||
PlayerPrefs.SetInt(key_prizesgiven, PlayerPrefs.GetInt(key_prizesgiven) + 1);
|
||||
PlayerPrefs.SetInt(key_prizesgivenNul, PlayerPrefs.GetInt(key_prizesgivenNul) + 1);
|
||||
string prizeCounterKey = Type switch
|
||||
{
|
||||
PrizeType.Special => SpecialPrizeCounter,
|
||||
PrizeType.Marbles => MarblesPrizeCounter,
|
||||
PrizeType.Hopper => HopperPrizeCounter,
|
||||
PrizeType.Hopper2 => HopperPrizeCounter,
|
||||
PrizeType.Ticket => TicketPrizeCounter,
|
||||
_ => "none"};
|
||||
|
||||
string prizeCounterKeyNullable = prizeCounterKey + "Nullable";
|
||||
|
||||
|
||||
PlayerPrefs.SetInt(prizeCounterKey, PlayerPrefs.GetInt(prizeCounterKey, 0) + 1);
|
||||
PlayerPrefs.SetInt(prizeCounterKeyNullable, PlayerPrefs.GetInt(prizeCounterKeyNullable, 0) + 1);
|
||||
}
|
||||
|
||||
public static void ResetPrizeCounters()
|
||||
{
|
||||
PlayerPrefs.SetInt(HopperPrizeCounter + "Nullable", 0);
|
||||
PlayerPrefs.SetInt(MarblesPrizeCounter + "Nullable", 0);
|
||||
PlayerPrefs.SetInt(TicketPrizeCounter + "Nullable", 0);
|
||||
PlayerPrefs.SetInt(SpecialPrizeCounter + "Nullable", 0);
|
||||
}
|
||||
|
||||
public static string GetPrizesCounterNullableString()
|
||||
{
|
||||
StringBuilder sb = new();
|
||||
|
||||
sb.Append($"Х: {PlayerPrefs.GetInt(HopperPrizeCounter + "Nullable", 0)}. ");
|
||||
sb.Append($"Т: {PlayerPrefs.GetInt(TicketPrizeCounter + "Nullable", 0)}. ");
|
||||
sb.Append($"М: {PlayerPrefs.GetInt(MarblesPrizeCounter + "Nullable", 0)}. ");
|
||||
sb.Append($"С: {PlayerPrefs.GetInt(SpecialPrizeCounter + "Nullable", 0)}. ");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string GetPrizesCounterString()
|
||||
{
|
||||
StringBuilder sb = new();
|
||||
|
||||
sb.Append($"Х: {PlayerPrefs.GetInt(HopperPrizeCounter, 0)}. ");
|
||||
sb.Append($"Т: {PlayerPrefs.GetInt(TicketPrizeCounter, 0)}. ");
|
||||
sb.Append($"М: {PlayerPrefs.GetInt(MarblesPrizeCounter, 0)}. ");
|
||||
sb.Append($"С: {PlayerPrefs.GetInt(SpecialPrizeCounter, 0)}. ");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void InitCounters()
|
||||
{
|
||||
if (!PlayerPrefs.HasKey(key_starts)) PlayerPrefs.SetInt(key_starts, 0);
|
||||
if (!PlayerPrefs.HasKey(key_startsNul)) PlayerPrefs.SetInt(key_startsNul, 0);
|
||||
if (!PlayerPrefs.HasKey(key_prizesgiven)) PlayerPrefs.SetInt(key_prizesgiven, 0);
|
||||
if (!PlayerPrefs.HasKey(key_prizesgivenNul)) PlayerPrefs.SetInt(key_prizesgivenNul, 0);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ public class DifficultyView : MonoBehaviour
|
||||
{
|
||||
sb.AppendLine("-<color=orange>Фиксированная</color>. ");
|
||||
sb.AppendLine($"-Текущая сложность ботов: {SettingsManager.GetString("Difficulty", "?")}.");
|
||||
sb.AppendLine("-Сложность берется из настроек и не меняется в зависимости от монет и счетчика импульсов.");
|
||||
sb.AppendLine("-Сложность берется из настройки <color=lightblue>\"Сложность ботов\" и не меняется в зависимости от монет и счетчика импульсов.");
|
||||
sb.AppendLine("-Босс ходит первым.");
|
||||
|
||||
label.text = sb.ToString();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user