更改文件架构
This commit is contained in:
34
Packages/Common~/Scripts/UX/Waiting/WaitingScreen.cs
Normal file
34
Packages/Common~/Scripts/UX/Waiting/WaitingScreen.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine.UIElements;
|
||||
namespace BITKit
|
||||
{
|
||||
public class WaitingScreen : MonoBehaviour
|
||||
{
|
||||
static ValidHandle isWaiting = new();
|
||||
public static void Excute(object obj)
|
||||
{
|
||||
isWaiting.AddElement(obj);
|
||||
}
|
||||
public static void Complete(object obj)
|
||||
{
|
||||
isWaiting.RemoveElement(obj);
|
||||
}
|
||||
[Header(Constant.Header.Components)]
|
||||
public UIDocument document;
|
||||
void Start()
|
||||
{
|
||||
isWaiting = new();
|
||||
isWaiting.AddListener(SetWaiting);
|
||||
|
||||
isWaiting.Invoke();
|
||||
}
|
||||
async void SetWaiting(bool wait)
|
||||
{
|
||||
await UniTask.SwitchToMainThread();
|
||||
document.rootVisualElement.SetActive(wait);
|
||||
}
|
||||
}
|
||||
}
|
11
Packages/Common~/Scripts/UX/Waiting/WaitingScreen.cs.meta
Normal file
11
Packages/Common~/Scripts/UX/Waiting/WaitingScreen.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 241915c4814e5224f9d3ffd6dab7a98e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user