浏览代码

Added loadingScreenManager to listen to UI toggle events

/main
Amel Negra 4 年前
当前提交
424f4bdf
共有 2 个文件被更改,包括 41 次插入0 次删除
  1. 30
      UOP1_Project/Assets/Scripts/SceneManagement/LoadingScreenManager.cs
  2. 11
      UOP1_Project/Assets/Scripts/SceneManagement/LoadingScreenManager.cs.meta

30
UOP1_Project/Assets/Scripts/SceneManagement/LoadingScreenManager.cs


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);
}
}

11
UOP1_Project/Assets/Scripts/SceneManagement/LoadingScreenManager.cs.meta


fileFormatVersion: 2
guid: 66ced4c879634014997808cfc063a88a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存