add project files

This commit is contained in:
Boris Nikolaev
2026-08-14 01:58:31 +03:00
parent 9134cad79b
commit 5f1e94b653
4399 changed files with 12286903 additions and 0 deletions
@@ -0,0 +1,30 @@
using UnityEngine;
using UnityEngine.UI;
public class ButtonClickSound : MonoBehaviour
{
public bool collectButton;
private void Start()
{
ButtonSoundsController controller = ButtonSoundsController.Instance;
if (controller == null)
{
return;
}
Button button = GetComponent<Button>();
if (button != null)
{
button.onClick.AddListener(controller.OnButtonClick);
return;
}
Toggle toggle = GetComponent<Toggle>();
if (toggle != null)
{
toggle.onValueChanged.AddListener(delegate
{
controller.OnButtonClick();
});
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0a0d639ecfe3dea4da05456534efc38e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,15 @@
using UnityEngine;
using OHM.UnityToolkit;
using UnityEngine.Serialization;
public class ButtonSoundsController : UniqueInstance<ButtonSoundsController>
{
[SerializeField]
[FormerlySerializedAs("clickSound")]
private SFX _clickSound;
public void OnButtonClick()
{
_clickSound.Play(base.transform);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dce4cc43d49f0a271ef1155f67e1c038
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,103 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Ambiance;
using OHM.UnityToolkit.UI;
using UnityEngine.Serialization;
public class UIAmbiancesProgression : MonoBehaviour
{
[SerializeField]
private UIIncrementableGauge progression;
[SerializeField]
[FormerlySerializedAs("thumbCurrent")]
private Image _thumbCurrent;
[SerializeField]
[FormerlySerializedAs("thumbAfter")]
private Image _thumbAfter;
[SerializeField]
[FormerlySerializedAs("levelStart")]
private TextWrapper _levelStart;
[SerializeField]
[FormerlySerializedAs("levelEnd")]
private TextWrapper _levelEnd;
[SerializeField]
[FormerlySerializedAs("levelPrefab")]
private UIAmbiancesProgressionLevel _levelPrefab;
[SerializeField]
private Transform levelCont;
[SerializeField]
[FormerlySerializedAs("unlockObject")]
private GameObject _unlockObject;
internal AppController appController;
private int _chestLevelIdx;
private UIAmbiancesProgressionLevel _chestLevel;
private void Start()
{
AmbianceController.Instance.OnAmbianceChange.AddListener(Refresh);
}
public void Setup(AppController app)
{
appController = app;
}
public void Refresh()
{
AmbianceController ambiances = AmbianceController.Instance;
List<AmbianceDef> list = ambiances.ambiancesDef.GetAmbiancesList();
int realIdx = ambiances.CurrentAmbianceRealIdx;
_thumbCurrent.sprite = list[realIdx].thumb;
_thumbAfter.sprite = list[(realIdx + 1) % list.Count].thumb;
int changeCount = ambiances.changeAmbianceSectionCount;
progression.QuickResetToLevel(0, (float)(ambiances.CurrentLevelIdx % changeCount) / (float)changeCount);
foreach (Transform child in levelCont)
{
Object.Destroy(child.gameObject);
}
_chestLevel = null;
int start = changeCount * ambiances.CurrentAmbianceIdx + 1;
_levelStart.text = start.ToString();
_levelEnd.text = (start + changeCount).ToString();
for (int i = 1; i < changeCount; i++)
{
UIAmbiancesProgressionLevel level = Object.Instantiate(_levelPrefab, levelCont);
int levelNum = i + start;
level.Setup(levelNum, (float)i / (float)changeCount);
}
_unlockObject.SetActive(value: false);
}
public void Victory()
{
AmbianceController ambiances = AmbianceController.Instance;
int changeCount = ambiances.changeAmbianceSectionCount;
int step = ambiances.CurrentLevelIdx % changeCount + 1;
progression.SetTargetValue((float)step / (float)changeCount, 0);
if (step == 5)
{
_unlockObject.SetActive(value: true);
}
if (_chestLevel != null && appController.GetPlayerLevel() - 1 == _chestLevelIdx)
{
_chestLevel.ShowChest();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0f8a09224e7e10664ce6f69d22677001
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,41 @@
using UnityEngine;
using UnityEngine.Serialization;
public class UIAmbiancesProgressionLevel : MonoBehaviour
{
[SerializeField]
[FormerlySerializedAs("levelTxt")]
private TextWrapper _levelTxt;
[SerializeField]
[FormerlySerializedAs("rectTransform")]
private RectTransform _rectTransform;
[SerializeField]
[FormerlySerializedAs("chestIcon")]
private GameObject _chestIcon;
[SerializeField]
[FormerlySerializedAs("bonusIcon")]
private GameObject _bonusIcon;
public void Setup(int levelNum, float lRatio)
{
_levelTxt.text = levelNum.ToString();
_rectTransform.anchorMin = new Vector2(lRatio, 0.5f);
_rectTransform.anchorMax = new Vector2(lRatio, 0.5f);
_chestIcon.SetActive(value: false);
_bonusIcon.SetActive(value: false);
}
public void ShowChest()
{
_chestIcon.SetActive(value: true);
}
public void ShowBonus()
{
_bonusIcon.SetActive(value: true);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 37612a1c9bda7587f76e7d7119ba30c8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+16
View File
@@ -0,0 +1,16 @@
public class UICoins : UIInventoryCount
{
public override void Setup(AppController appController)
{
base.appController = appController;
RefreshCurrency();
counter.Init(appController.GetCurrencies());
appController.onCurrenciesChanged.AddListener(RefreshCurrency);
appController.coreGame.currenciesController.onWinCurrencies += OnCollectAlign;
}
private void RefreshCurrency()
{
counter.SetTargetValue(appController.GetCurrencies());
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0cad7deb9a70f3db46ebc7a770e386ce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+75
View File
@@ -0,0 +1,75 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Serialization;
public class UIConfirmPopup : UIMenu
{
[SerializeField]
[FormerlySerializedAs("confirmButton")]
private Button _confirmButton;
[SerializeField]
[FormerlySerializedAs("cancelButton")]
private Button _cancelButton;
[SerializeField]
[FormerlySerializedAs("confirmButtonText")]
private TextWrapper _confirmButtonText;
private Action _onConfirm;
private Action _onCancel;
private void Awake()
{
_confirmButton.onClick.AddListener(Confirm);
_cancelButton.onClick.AddListener(Cancel);
}
public override bool OnBack()
{
if (_onCancel != null)
{
_onCancel();
}
return base.OnBack();
}
public void Show(Action confirm, Action cancel = null)
{
_onConfirm = confirm;
_onCancel = cancel;
_cancelButton.gameObject.SetActive(cancel != null);
Show();
}
public void ActiveCancelButton(bool active)
{
_cancelButton.gameObject.SetActive(active);
}
public void SetTextConfirmButton(string text)
{
_confirmButtonText.text = text;
}
public void Confirm()
{
if (_onConfirm != null)
{
_onConfirm();
}
Hide();
}
public void Cancel()
{
if (_onCancel != null)
{
_onCancel();
}
Hide();
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dcd53704142b35c6ed6b141172bae029
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+141
View File
@@ -0,0 +1,141 @@
using UnityEngine;
using OHM.UnityToolkit.Pooling;
using OHM.UnityToolkit.UI;
using UnityEngine.Serialization;
public class UICoreGame : UIMenu
{
[SerializeField]
private UIIncrementableCounter level;
[SerializeField]
[FormerlySerializedAs("score")]
private UIIncrementableCounter _score;
[SerializeField]
[FormerlySerializedAs("poppingStatusPrefab")]
private SizePrefabUI _poppingStatusPrefab;
[SerializeField]
[FormerlySerializedAs("poppingGainPrefab")]
private UIIncrementableCounter _poppingGainPrefab;
[SerializeField]
[FormerlySerializedAs("poppingLosePrefab")]
private UIIncrementableCounter _poppingLosePrefab;
[SerializeField]
[FormerlySerializedAs("reuseSizeUpDelay")]
private float _reuseSizeUpDelay;
[SerializeField]
private Transform spawnCont;
[SerializeField]
[FormerlySerializedAs("quitConfirmPopup")]
private UIConfirmPopup _quitConfirmPopup;
private SizePrefabUI _sizeTxt;
private UIIncrementableCounter _poppingSizeUp;
private float _sizeUpTime;
private float _sizeUpValue;
private UIIncrementableCounter _poppingSizeDown;
private float _sizeDownTime;
private float _sizeDownValue;
public override void OnSetup()
{
appController.coreGame.scoreController.onScore.AddListener(OnScore);
}
public override void Show()
{
base.Show();
CleanUI();
level.SetTargetValue(appController.GetPlayerLevel() + 1);
_score.Init(appController.coreGame.scoreController.Score);
appController.coreGame.CurrentPlayer.richManagePlayer.VisualPlayerRichPoor.onChangeStatus += OnChangeStatus;
appController.coreGame.CurrentPlayer.richManagePlayer.onChangeMoney += OnChangeMoney;
}
private void OnScore(int s, Transform obj, ScoreController.ScoreType type)
{
_score.SetTargetValue(appController.coreGame.scoreController.Score);
}
private void OnChangeStatus(TypeRich typeRich, Color color)
{
SizePrefabUI popup = UnityEngine.Object.Instantiate(_poppingStatusPrefab, spawnCont);
if (popup != null)
{
popup.SetText(typeRich.locKey, color);
}
}
private void CleanUI()
{
if (_sizeTxt != null)
{
UnityEngine.Object.DestroyImmediate(_sizeTxt.gameObject);
}
if (_poppingSizeUp != null)
{
UnityEngine.Object.DestroyImmediate(_poppingSizeUp.gameObject);
}
if (_poppingSizeDown != null)
{
UnityEngine.Object.DestroyImmediate(_poppingSizeDown.gameObject);
}
foreach (Transform child in spawnCont)
{
UnityEngine.Object.DestroyImmediate(child.gameObject);
}
}
private void OnChangeMoney(float value)
{
if (value > 0f)
{
if (Time.time > _sizeUpTime || _poppingSizeUp == null)
{
_sizeUpValue = 0f;
_poppingSizeUp = PoolsManager.InstantiatePrefab(_poppingGainPrefab, spawnCont, spawnCont.position, Quaternion.identity);
}
_sizeUpValue += value;
_poppingSizeUp.SetTargetValue((long)_sizeUpValue);
_poppingSizeUp.gameObject.SetActive(value: true);
_sizeUpTime = Time.time + _reuseSizeUpDelay;
}
else if (value < 0f)
{
if (Time.time > _sizeDownTime || _poppingSizeDown == null)
{
_sizeDownValue = 0f;
_poppingSizeDown = PoolsManager.InstantiatePrefab(_poppingLosePrefab, spawnCont, spawnCont.position, Quaternion.identity);
}
_sizeDownValue += value;
_poppingSizeDown.SetTargetValue((long)System.Math.Abs(_sizeDownValue));
_poppingSizeDown.gameObject.SetActive(value: true);
_sizeDownTime = Time.time + _reuseSizeUpDelay;
}
}
public void TryQuit()
{
Time.timeScale = 0f;
_quitConfirmPopup.Show(delegate
{
Time.timeScale = 1f;
appController.Quit();
}, delegate
{
Time.timeScale = 1f;
});
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 36bf927f5f90f50648711d950444f959
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,35 @@
using UnityEngine;
using UnityEngine.Serialization;
public class UIDisplayOnTouch : MonoBehaviour
{
[SerializeField]
private CoreDef CoreDef;
[SerializeField]
[FormerlySerializedAs("humanHandAnim")]
private Animator _humanHandAnim;
private bool _isShown;
private void Start()
{
_isShown = false;
_humanHandAnim.SetBool("IsVisible", value: false);
}
private void Update()
{
bool visible = false;
if (CoreDef.showHumanHand)
{
visible = Input.GetMouseButton(0);
_humanHandAnim.transform.position = Input.mousePosition;
}
if (_isShown != visible)
{
_humanHandAnim.SetBool("IsVisible", visible);
_isShown = visible;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 270d9b1804a98b2a6be760a01f9e63a1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+85
View File
@@ -0,0 +1,85 @@
using UnityEngine;
using OHM.UnityToolkit;
using OHM.UnityToolkit.UI;
using UnityEngine.Serialization;
public class UIGameOver : UIMenu
{
[SerializeField]
private UIIncrementableCounter levelCounter;
[SerializeField]
[FormerlySerializedAs("distanceTxt")]
private TextWrapper _distanceTxt;
[SerializeField]
[FormerlySerializedAs("retryCont")]
private GameObject _retryCont;
[SerializeField]
[FormerlySerializedAs("respawnCont")]
private GameObject _respawnCont;
[SerializeField]
[FormerlySerializedAs("respawnGauge")]
private UIIncrementableGauge _respawnGauge;
[SerializeField]
private SFX sfx;
private float _showTime;
private float _duration;
public override void Show()
{
base.Show();
if (levelCounter != null)
{
levelCounter.Init(appController.GetPlayerLevel() + 1);
}
_respawnCont.gameObject.SetActive(value: false);
_retryCont.gameObject.SetActive(value: false);
sfx.Play(base.transform);
ShowRespawn();
}
private void ShowRespawn()
{
_showTime = Time.unscaledTime;
bool canRevive = false;
_respawnCont.gameObject.SetActive(canRevive);
_retryCont.gameObject.SetActive(!canRevive);
_respawnGauge.QuickResetToLevel(0, 1f, force: true);
}
public void Quit()
{
appController.Quit();
}
private void Update()
{
if (!_respawnCont.gameObject.activeSelf)
{
return;
}
float ratio = 1f - (Time.unscaledTime - _showTime) / _duration;
if (ratio > 0f)
{
_respawnGauge.SetTargetValue(ratio, 0);
}
else
{
_respawnCont.gameObject.SetActive(value: false);
_retryCont.gameObject.SetActive(value: true);
}
}
public void NoThanks()
{
_respawnCont.gameObject.SetActive(value: false);
_retryCont.gameObject.SetActive(value: true);
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d5bddbe7b33f8afd2112b5a15a381b60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+14
View File
@@ -0,0 +1,14 @@
using UnityEngine;
using UnityEngine.Serialization;
public class UIHud : MonoBehaviour
{
[SerializeField]
[FormerlySerializedAs("uiCoins")]
private UICoins _uiCoins;
public void Setup(AppController app)
{
_uiCoins.Setup(app);
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cc0650ff15d0a21e00dfc755580fc26f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+115
View File
@@ -0,0 +1,115 @@
using System;
using System.Collections;
using UnityEngine;
using OHM.UnityToolkit;
using OHM.UnityToolkit.Pooling;
using OHM.UnityToolkit.UI;
using UnityEngine.Serialization;
public class UIInventoryCount : MonoBehaviour
{
[SerializeField]
protected UIIncrementableCounter counter;
[SerializeField]
[FormerlySerializedAs("poppingPrefab")]
private UIMoveToTarget _poppingPrefab;
[SerializeField]
private RectTransform TargetPos;
[SerializeField]
private Transform poppingCont;
[SerializeField]
private float minPoppinDT;
[SerializeField]
[FormerlySerializedAs("maxPoppingGroupDuration")]
private float _maxPoppingGroupDuration;
[SerializeField]
[FormerlySerializedAs("maxPoppingGroupDelta")]
private Vector3 _maxPoppingGroupDelta;
[SerializeField]
private int maxCount = int.MaxValue;
[SerializeField]
[FormerlySerializedAs("collectSFX")]
private SFX _collectSFX;
[SerializeField]
[FormerlySerializedAs("collectDoneSFX")]
private SFX _collectDoneSFX;
protected AppController appController;
private float _nextPoppingCoinMinTime;
public virtual void Setup(AppController appController)
{
this.appController = appController;
}
protected void OnCollectAlign(int count, Transform from)
{
OnCollect(count, from, align: true);
}
protected void OnCollect(int count, Transform from, bool align = true)
{
if (!base.gameObject.activeInHierarchy)
{
return;
}
int popCount = Mathf.Min(count, maxCount);
float groupDT = 0f;
if (popCount >= 2)
{
groupDT = Mathf.Clamp(_maxPoppingGroupDuration / popCount, 0f, minPoppinDT);
}
Vector3 delta = Vector3.zero;
for (int i = 0; i < popCount; i++)
{
float delay = Mathf.Max(0f, _nextPoppingCoinMinTime - Time.time);
StartCoroutine(PopCoin(delay, from, delta, i == 0, align));
delta = new Vector3(
UnityEngine.Random.Range(0f - _maxPoppingGroupDelta.x, _maxPoppingGroupDelta.x),
UnityEngine.Random.Range(0f - _maxPoppingGroupDelta.y, _maxPoppingGroupDelta.y),
UnityEngine.Random.Range(0f - _maxPoppingGroupDelta.z, _maxPoppingGroupDelta.z));
_nextPoppingCoinMinTime = Time.time + delay + groupDT;
}
if (_collectSFX != null)
{
_collectSFX.Play(base.transform);
}
}
protected IEnumerator PopCoin(float delay, Transform from, Vector3 delta, bool doneSfx, bool align = true)
{
Vector3 fromPos = from.position;
yield return new WaitForSeconds(delay);
UIMoveToTarget popping = PoolsManager.InstantiatePrefab(_poppingPrefab, poppingCont,
poppingCont.position, poppingCont.rotation);
if (popping == null)
{
yield break;
}
popping.target = TargetPos;
fromPos += delta;
if (align)
{
UIUtils.AlignToWorldPosition(fromPos, popping.GetComponent<RectTransform>());
}
popping.gameObject.SetActive(true);
if (doneSfx && _collectDoneSFX != null)
{
popping.onMoveDone.AddListener(delegate
{
_collectDoneSFX.Play(base.transform);
});
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 23e1cd70d45168844d3d56b99f32eb07
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+81
View File
@@ -0,0 +1,81 @@
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using OHM.UnityToolkit;
using OHM.UnityToolkit.UI;
using UnityEngine.Serialization;
public class UIMainMenu : UIMenu
{
[SerializeField]
private TextWrapper version;
[SerializeField]
private UIIncrementableCounter level;
[SerializeField]
[FormerlySerializedAs("bestScore")]
private UIIncrementableCounter _bestScore;
[SerializeField]
private Toggle vibrationToggle;
[SerializeField]
private Toggle soundsToggle;
[SerializeField]
[FormerlySerializedAs("ambianceProgression")]
private UIAmbiancesProgression _ambianceProgression;
[SerializeField]
public UISettings settings;
[SerializeField]
private GameObject StartRichButton;
public override void OnSetup()
{
if (_ambianceProgression != null)
{
_ambianceProgression.appController = appController;
}
}
public override void Show()
{
base.Show();
if (version != null)
{
version.text = VersionUtils.GetVersionData().GetVersionLongName();
}
if (_bestScore != null)
{
_bestScore.Init(appController.GetBestScore());
}
if (level != null)
{
level.Init(appController.GetPlayerLevel() + 1);
}
if (_ambianceProgression != null)
{
_ambianceProgression.Refresh();
}
StartRichButton.SetActive(value: false);
}
public override void Hide()
{
base.Hide();
}
public void StartGame()
{
appController.Go();
}
public void OpenSettings()
{
settings.Show();
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 101edd0aba1c9436a9c8806587abf2ed
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+16
View File
@@ -0,0 +1,16 @@
using OHM.UnityToolkit.UI;
public class UIMenu : UIMenuBase
{
protected AppController appController;
public void Setup(AppController controller)
{
appController = controller;
OnSetup();
}
public virtual void OnSetup()
{
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: eba83f4f74f6150a285b7a94e6549c17
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,83 @@
using UnityEngine;
using OHM.UnityToolkit.UI;
using UnityEngine.Serialization;
public class UIRootController : MonoBehaviour
{
[SerializeField]
[FormerlySerializedAs("appController")]
private AppController _appController;
public UIMainMenu mainMenu;
public UICoreGame coreGame;
public UIGameOver gameOver;
public UIVictory victory;
public UIHud hud;
private void Awake()
{
InitSubMenus();
hud.Setup(_appController);
_appController.onGameExited.AddListener(OnGameExited);
_appController.coreGame.onGameStarted.AddListener(OnCoreGameStarted);
_appController.coreGame.onGameOver.AddListener(OnGameOver);
_appController.onLevelCleared.AddListener(OnGameWon);
}
private void Start()
{
if (mainMenu != null)
{
mainMenu.Show();
}
}
private void InitSubMenus()
{
UIMenu[] menus = GetComponentsInChildren<UIMenu>(true);
for (int i = 0; i < menus.Length; i++)
{
menus[i].Setup(_appController);
}
}
public void OnGameExited()
{
if (mainMenu != null)
{
mainMenu.Show();
}
GetComponent<UIMenusController>().HideAllExcept(mainMenu);
}
public void OnCoreGameStarted()
{
if (coreGame != null)
{
coreGame.Show();
}
GetComponent<UIMenusController>().HideAllExcept(coreGame);
}
public void OnGameOver()
{
if (gameOver != null)
{
gameOver.Show();
}
GetComponent<UIMenusController>().HideAllExcept(gameOver);
}
public void OnGameWon()
{
if (victory != null)
{
victory.Show();
}
GetComponent<UIMenusController>().HideAllExcept(victory);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a259b49582500a066bccb1ee799b9394
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 50
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+57
View File
@@ -0,0 +1,57 @@
using UnityEngine;
using UnityEngine.UI;
using OHM.UnityToolkit;
using UnityEngine.Serialization;
public class UISettings : UIMenu
{
[SerializeField]
private TextWrapper version;
[SerializeField]
private Toggle vibrationToggle;
[SerializeField]
private Toggle soundsToggle;
[SerializeField]
[FormerlySerializedAs("toggleSettings")]
private Toggle _toggleSettings;
public override void Show()
{
base.Show();
InitVibrate();
InitSounds();
if (version != null)
{
version.text = VersionUtils.GetVersionData().GetVersionLongName();
}
}
public void InitVibrate()
{
if (vibrationToggle != null)
{
vibrationToggle.isOn = AppSettings.Instance.VibrationsEnabled;
}
}
public void InitSounds()
{
if (soundsToggle != null)
{
soundsToggle.isOn = AppSettings.Instance.AudioEnabled;
}
}
public void ToggleVibrate(bool on)
{
AppSettings.Instance.VibrationsEnabled = on;
}
public void ToggleAudio(bool on)
{
AppSettings.Instance.AudioEnabled = on;
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c204ba806d9e8d19bda46fd22d6e6285
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+80
View File
@@ -0,0 +1,80 @@
using OHM.UnityToolkit;
using OHM.UnityToolkit.UI;
using UnityEngine;
using UnityEngine.Serialization;
public class UIVictory : UIMenu
{
[SerializeField]
[FormerlySerializedAs("scoreCounter")]
private UIIncrementableCounter _scoreCounter;
[SerializeField]
private UIIncrementableCounter levelCounter;
[SerializeField]
[FormerlySerializedAs("best")]
private GameObject _best;
[SerializeField]
[FormerlySerializedAs("continueCoins")]
private GameObject _continueCoins;
[SerializeField]
[FormerlySerializedAs("continueNoCoins")]
private GameObject _continueNoCoins;
[SerializeField]
[FormerlySerializedAs("collectDuration")]
private float _collectDuration = 0.8f;
[SerializeField]
private SFX sfx;
private bool _canGetMoney;
public override void Show()
{
base.Show();
_canGetMoney = true;
if (_scoreCounter != null)
{
_scoreCounter.Init(0L);
_scoreCounter.SetTargetValue(appController.coreGame.scoreController.Score);
}
_continueCoins.SetActive(value: false);
_continueNoCoins.SetActive(value: false);
if (levelCounter != null)
{
levelCounter.Init(appController.GetPlayerLevel());
}
if (_best != null)
{
_best.SetActive(appController.coreGame.scoreController.Score >= appController.GetBestScore());
}
ShowContinuesButton();
}
private void ShowContinuesButton()
{
_continueCoins.SetActive(value: true);
_continueNoCoins.SetActive(value: false);
sfx.Play(base.transform);
}
public void CollectAndContinue()
{
if (_canGetMoney)
{
appController.coreGame.WinCurrencies();
_canGetMoney = false;
}
Invoke(nameof(Quit), _collectDuration);
}
private void Quit()
{
appController.Quit();
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7211dfe3f5c8d898372d2353156dbc3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: