You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB
C#

2 weeks ago
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Panel_LoadingData : TWS_UIPanel
{
private Transform UI_Parent;
public GameObject taskPrefab;
public GameObject loadingBarPrefab;
public override void Initialize()
{
UI_Parent = transform;
if(!GameData.Instance.SkipSplash)
{
TWS_SplashScreenStoryManager.Instance.LoadStoryData(LoadStoryDataIntoUI, UI_Parent);
TWS_Delegates._OnAllGameDataLoaded = OnAllGameDataLoaded;
}
else
OnAllGameDataLoaded();
}
void SpawnGameLoadingTasks()
{
Instantiate(taskPrefab);
}
void LoadStoryDataIntoUI(GameObject storyData)
{
PI_StoryData storyDataComponent = storyData.GetComponent<PI_StoryData>();
storyDataComponent.LaunchStory();
SpawnGameLoadingTasks();
Instantiate(loadingBarPrefab, UI_Parent);
}
private void OnAllGameDataLoaded() => GameManager.Instance.InitRunner();
// void OpenCharacterCreationPanel()
// {
// UI_Manager.Instance.OpenPanel<Panel_CharacterCreationMale>();
// }
}