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