Add prefab and ui of revive system
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d3dade62ffd2b747ad4cf751375e0cb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace BrewMonster
|
||||
{
|
||||
public class PopupManager : MonoBehaviour
|
||||
{
|
||||
public static PopupManager Instance { get; private set; }
|
||||
|
||||
[SerializeField] private GameObject ReviveOptionPopup;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (Instance == this)
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPlayerDied()
|
||||
{
|
||||
ReviveOptionPopup.SetActive(true);
|
||||
}
|
||||
public void OnPlayerRevived()
|
||||
{
|
||||
ReviveOptionPopup.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f59d26366995e974794ca221d3b05702
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using BrewMonster.Network;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace BrewMonster
|
||||
{
|
||||
public class RevivePopup : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Button velang_btn;
|
||||
[SerializeField] private Button dungbua_btn;
|
||||
[SerializeField] private Button tiepnhan_btn;
|
||||
[SerializeField] private Button kimthannietban_btn;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
OnReviveOptionSelected();
|
||||
}
|
||||
|
||||
private void OnReviveOptionSelected()
|
||||
{
|
||||
velang_btn.onClick.AddListener(ReviveInBase);
|
||||
dungbua_btn.onClick.AddListener(ReviveByItem);
|
||||
tiepnhan_btn.onClick.AddListener(ReviveByPlayer);
|
||||
kimthannietban_btn.onClick.AddListener(ReviveBySpecial);
|
||||
}
|
||||
|
||||
private void ReviveInBase()
|
||||
{
|
||||
UnityGameSession.RequestReviveBase();
|
||||
}
|
||||
|
||||
private void ReviveByItem()
|
||||
{
|
||||
UnityGameSession.RequestReviveItem();
|
||||
}
|
||||
|
||||
private void ReviveByPlayer()
|
||||
{
|
||||
UnityGameSession.RequestReviveByPlayer();
|
||||
}
|
||||
|
||||
private void ReviveBySpecial()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea43e6bff571b4143abe635924ae14f2
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5a4a3ed5bf0e5a49ba0f89d26e1f36e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user