DEG-85 [Feat] 팝업패널 추가
This commit is contained in:
parent
de612d59c6
commit
c08a1d6656
BIN
Assets/LYM/Scenes/MainUI.unity
(Stored with Git LFS)
BIN
Assets/LYM/Scenes/MainUI.unity
(Stored with Git LFS)
Binary file not shown.
30
Assets/LYM/Scripts/PanelController.cs
Normal file
30
Assets/LYM/Scripts/PanelController.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
[RequireComponent(typeof(CanvasGroup))]
|
||||||
|
public class PanelController : MonoBehaviour
|
||||||
|
{
|
||||||
|
private CanvasGroup _canvasGroup;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
_canvasGroup = GetComponent<CanvasGroup>();
|
||||||
|
if (_canvasGroup == null) return;
|
||||||
|
_canvasGroup.alpha = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Show()
|
||||||
|
{
|
||||||
|
if (_canvasGroup == null) return;
|
||||||
|
_canvasGroup.alpha = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Hide()
|
||||||
|
{
|
||||||
|
if (_canvasGroup == null) return;
|
||||||
|
_canvasGroup.alpha = 0;
|
||||||
|
}
|
||||||
|
}
|
11
Assets/LYM/Scripts/PanelController.cs.meta
Normal file
11
Assets/LYM/Scripts/PanelController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 560d1480f9972024da2f147dcb690c0b
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
47
Assets/LYM/Scripts/PopupPanelController.cs
Normal file
47
Assets/LYM/Scripts/PopupPanelController.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class PopupPanelController : PanelController
|
||||||
|
{
|
||||||
|
[SerializeField] private GameObject confirmButton;
|
||||||
|
[SerializeField] private GameObject contradictButton;
|
||||||
|
|
||||||
|
public delegate void OnConfirmDelegate();
|
||||||
|
private OnConfirmDelegate _onConfirmDelegate;
|
||||||
|
public delegate void OnContradictDelegate();
|
||||||
|
private OnContradictDelegate _onContradictDelegate;
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
Show(false, "", () => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Show(bool isNeed2Contradict, string message, OnConfirmDelegate onConfirm)
|
||||||
|
{
|
||||||
|
confirmButton.SetActive(isNeed2Contradict);
|
||||||
|
_onConfirmDelegate = onConfirm;
|
||||||
|
base.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Show(bool isNeed2Contradict, string message, OnConfirmDelegate onConfirm, OnContradictDelegate onContradict)
|
||||||
|
{
|
||||||
|
confirmButton.SetActive(isNeed2Contradict);
|
||||||
|
_onConfirmDelegate = onConfirm;
|
||||||
|
_onContradictDelegate = onContradict;
|
||||||
|
base.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnClickConfirm()
|
||||||
|
{
|
||||||
|
_onConfirmDelegate?.Invoke();
|
||||||
|
base.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnClickContradict()
|
||||||
|
{
|
||||||
|
_onContradictDelegate?.Invoke();
|
||||||
|
base.Hide();
|
||||||
|
}
|
||||||
|
}
|
11
Assets/LYM/Scripts/PopupPanelController.cs.meta
Normal file
11
Assets/LYM/Scripts/PopupPanelController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 91387cf2e2f0f8e48af58f5ebd0a58be
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/LYM/UIPrefabs/MainUIPanel.prefab
(Stored with Git LFS)
Normal file
BIN
Assets/LYM/UIPrefabs/MainUIPanel.prefab
(Stored with Git LFS)
Normal file
Binary file not shown.
7
Assets/LYM/UIPrefabs/MainUIPanel.prefab.meta
Normal file
7
Assets/LYM/UIPrefabs/MainUIPanel.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: af302cb7f34774949ac2f82724408b56
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/LYM/UIPrefabs/PopupPanel.prefab
(Stored with Git LFS)
Normal file
BIN
Assets/LYM/UIPrefabs/PopupPanel.prefab
(Stored with Git LFS)
Normal file
Binary file not shown.
7
Assets/LYM/UIPrefabs/PopupPanel.prefab.meta
Normal file
7
Assets/LYM/UIPrefabs/PopupPanel.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7a9a730163181d242b2cac0393580c66
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user