workspace 폴더 커밋
This commit is contained in:
70
Assets/TMPFolder/Popup/UIPopupManager.cs
Normal file
70
Assets/TMPFolder/Popup/UIPopupManager.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using XED.Core;
|
||||
using XRLib;
|
||||
|
||||
namespace Studio.UI.Popup
|
||||
{
|
||||
public class UIPopupManager : UnitySingleton<UIPopupManager>
|
||||
{
|
||||
private GameObject popup;
|
||||
|
||||
//public override void AfterAwake()
|
||||
//{
|
||||
// base.AfterAwake();
|
||||
// SceneManager.sceneUnloaded += OnSceneUnloaded;
|
||||
|
||||
//}
|
||||
|
||||
//private void OnSceneUnloaded(Scene arg0)
|
||||
//{
|
||||
// if (popup != null) popup.transform.SetParent(null, false);
|
||||
// popup = null;
|
||||
//}
|
||||
|
||||
//private UIPopup Create(string prefabPath)
|
||||
//{
|
||||
|
||||
// var prefab = Resources.Load(prefabPath, typeof(GameObject)) as GameObject;
|
||||
|
||||
// popup = UnityEngine.Object.Instantiate(prefab);
|
||||
// var uiPopup = popup.GetComponent<UIPopup>();
|
||||
|
||||
// var canvas = FindAnyObjectByType<Canvas_Label>();
|
||||
// popup.transform.SetParent(canvas.Canvas.rootCanvas.transform, false);
|
||||
|
||||
// return uiPopup;
|
||||
//}
|
||||
|
||||
//public async UniTask<object> Show(string prefabPath, string title, string okButtonTitle = "OK", string cancelButtonTitle = "CANCEL", bool showCancelButton = true)
|
||||
//{
|
||||
// UIPopup uiPopup = Create(prefabPath);
|
||||
|
||||
// bool isClosed = false;
|
||||
// object result = null;
|
||||
|
||||
// uiPopup.Init(title, okButtonTitle, cancelButtonTitle, showCancelButton);
|
||||
|
||||
// uiPopup.OnOk += (object sender, UIPopupEventArgs args) =>
|
||||
// {
|
||||
// result = args.Data;
|
||||
// isClosed = true;
|
||||
// };
|
||||
|
||||
// uiPopup.OnCancel += (object sender, EventArgs args) =>
|
||||
// {
|
||||
// result = null;
|
||||
// isClosed = true;
|
||||
// };
|
||||
|
||||
// uiPopup.Open();
|
||||
|
||||
// await UniTask.WaitUntil(() => isClosed == true);
|
||||
// GameObject.Destroy(popup);
|
||||
// popup = null;
|
||||
// return result;
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user