Ciro Continisio
3 年前
当前提交
36d16456
共有 11 个文件被更改,包括 72 次插入 和 147 次删除
-
115UOP1_Project/Assets/Scenes/Managers/PersistentManagers.unity
-
2UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/FadeChannelSO.cs
-
6UOP1_Project/Assets/Scripts/UI/FadeController.cs
-
27UOP1_Project/Assets/Scripts/UI/LoadingInterfaceController.cs
-
17UOP1_Project/Assets/Scripts/UI/UISpinner.cs
-
33UOP1_Project/Assets/Scripts/SceneManagement/LoadingScreenManager.cs
-
19UOP1_Project/Assets/Scripts/SceneManagement/SpinningUI.cs
-
0/UOP1_Project/Assets/Scripts/UI/FadeController.cs.meta
-
0/UOP1_Project/Assets/Scripts/UI/FadeController.cs
-
0/UOP1_Project/Assets/Scripts/UI/LoadingInterfaceController.cs.meta
-
0/UOP1_Project/Assets/Scripts/UI/UISpinner.cs.meta
|
|||
using UnityEngine; |
|||
|
|||
public class LoadingInterfaceController : 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() |
|||
{ |
|||
_ToggleLoadingScreen.OnEventRaised += ToggleLoadingScreen; |
|||
} |
|||
|
|||
private void OnDisable() |
|||
{ |
|||
_ToggleLoadingScreen.OnEventRaised -= ToggleLoadingScreen; |
|||
} |
|||
|
|||
private void ToggleLoadingScreen(bool state) |
|||
{ |
|||
loadingInterface.SetActive(state); |
|||
} |
|||
|
|||
} |
|
|||
using UnityEngine; |
|||
|
|||
public class UISpinner : MonoBehaviour |
|||
{ |
|||
[SerializeField] private float _rotateSpeed = -150f; |
|||
private RectTransform rectComponent; |
|||
|
|||
private void Start() |
|||
{ |
|||
rectComponent = GetComponent<RectTransform>(); |
|||
} |
|||
|
|||
private void Update() |
|||
{ |
|||
rectComponent.Rotate(0f, 0f, _rotateSpeed * Time.deltaTime); |
|||
} |
|||
} |
|
|||
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); |
|||
} |
|||
|
|||
} |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
|
|||
public class SpinningUI : MonoBehaviour |
|||
{ |
|||
private RectTransform rectComponent; |
|||
public float rotateSpeed = 200f; |
|||
|
|||
private void Start() |
|||
{ |
|||
rectComponent = GetComponent<RectTransform>(); |
|||
} |
|||
|
|||
private void Update() |
|||
{ |
|||
rectComponent.Rotate(0f, 0f, rotateSpeed * Time.deltaTime); |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue