33 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
/// <summary>
/// Главный загрузчик.
/// </summary>
public class MainBootstrap : MonoBehaviour
{
[SerializeField] private ConfigCatalog ConfigCatalog;
private void Awake() => InitializeMangers();
private void InitializeMangers()
{
if (ConfigCatalog == null)
{
Debug.LogError("Не указан каталог конфигов", this);
return;
}
var catalogValidatinResult = ConfigCatalog.ValidateReferences();
if (!catalogValidatinResult.OK)
{
Debug.LogError($"Ошибка в каталоге конфига: \n{catalogValidatinResult.message}", this);
return;
}
WalletManager.Initialize(ConfigCatalog.WalletManagerConfig);
GameModesHolder.Initialize(ConfigCatalog.GameModesConfig);
Debug.Log("Главный загрузчик отработал");
BootstrapperState.MainBootstraped = true;
SceneLoader.LoadScene("Menu");
}
}