57 lines
1.4 KiB
C#
57 lines
1.4 KiB
C#
using UnityEngine;
|
|
|
|
public class GameBootLoader : BootLoader
|
|
{
|
|
[SerializeField] private GameObject[] baseObjects;
|
|
[SerializeField] private bool enableLogs = false;
|
|
|
|
private bool hasInitializedScriptables = false;
|
|
|
|
protected override void InitBootLoaders()
|
|
{
|
|
IBootLoader bootLoader = null;
|
|
|
|
foreach (GameObject loader in baseObjects)
|
|
{
|
|
if (GetLoader<IBootLoader>(loader.transform, out bootLoader))
|
|
{
|
|
bootLoader.Initialize();
|
|
}
|
|
}
|
|
}
|
|
protected override void InitializeData()
|
|
{
|
|
Debug.unityLogger.logEnabled = enableLogs;
|
|
Debug.Log($"InitializeData: for loaders");
|
|
InitializeScriptablesData();
|
|
|
|
IDataLoader dataLoader = null;
|
|
foreach (GameObject loader in baseObjects)
|
|
{
|
|
if (GetLoader<IDataLoader>(loader.transform, out dataLoader))
|
|
{
|
|
Debug.Log($"InitializeData: {loader.transform.name}");
|
|
dataLoader.InitializeData();
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
base.Start();
|
|
}
|
|
|
|
private void InitializeScriptablesData()
|
|
{
|
|
// if (!hasInitializedScriptables)
|
|
// {
|
|
// foreach (BaseSO scriptableObject in scriptables)
|
|
// {
|
|
// scriptableObject.InitData();
|
|
// }
|
|
|
|
// hasInitializedScriptables = true;
|
|
// }
|
|
}
|
|
}
|