2026-01-20 20:17:48 +05:30
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class GameBootLoader : BootLoader
|
|
|
|
|
{
|
|
|
|
|
[SerializeField] private GameObject[] baseObjects;
|
|
|
|
|
// [SerializeField] private BaseSO[] scriptables;
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
{
|
2026-01-28 20:57:35 +05:30
|
|
|
Debug.Log($"InitializeData: for loaders");
|
2026-01-20 20:17:48 +05:30
|
|
|
InitializeScriptablesData();
|
|
|
|
|
|
|
|
|
|
IDataLoader dataLoader = null;
|
|
|
|
|
foreach (GameObject loader in baseObjects)
|
|
|
|
|
{
|
|
|
|
|
if (GetLoader<IDataLoader>(loader.transform, out dataLoader))
|
|
|
|
|
{
|
2026-01-28 20:57:35 +05:30
|
|
|
Debug.Log($"InitializeData: {loader.transform.name}");
|
2026-01-20 20:17:48 +05:30
|
|
|
dataLoader.InitializeData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Start()
|
|
|
|
|
{
|
|
|
|
|
base.Start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void InitializeScriptablesData()
|
|
|
|
|
{
|
|
|
|
|
// if (!hasInitializedScriptables)
|
|
|
|
|
// {
|
|
|
|
|
// foreach (BaseSO scriptableObject in scriptables)
|
|
|
|
|
// {
|
|
|
|
|
// scriptableObject.InitData();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// hasInitializedScriptables = true;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|