您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
33 行
671 B
33 行
671 B
using UnityEngine;
|
|
|
|
public class LoadingScreenManager : MonoBehaviour
|
|
{
|
|
[Header("Loading screen Event")]
|
|
//The loading screen event we are listening to
|
|
[SerializeField] private BoolEventChannelSO _ToggleLoadingScreen = default;
|
|
|
|
[Header("Loading screen ")]
|
|
public GameObject loadingInterface;
|
|
|
|
private void OnEnable()
|
|
{
|
|
if (_ToggleLoadingScreen != null)
|
|
{
|
|
_ToggleLoadingScreen.OnEventRaised += ToggleLoadingScreen;
|
|
}
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
if (_ToggleLoadingScreen != null)
|
|
{
|
|
_ToggleLoadingScreen.OnEventRaised -= ToggleLoadingScreen;
|
|
}
|
|
}
|
|
|
|
private void ToggleLoadingScreen(bool state)
|
|
{
|
|
loadingInterface.SetActive(state);
|
|
}
|
|
|
|
}
|