sounds and screens with improved matchmaker
This commit is contained in:
@@ -3,6 +3,7 @@ using UnityEngine.UI;
|
||||
using DG.Tweening;
|
||||
using UnityEngine.SceneManagement;
|
||||
using System.Collections;
|
||||
using TMPro;
|
||||
public class LevelLoadManager : MonoBehaviour
|
||||
{
|
||||
public static LevelLoadManager instance;
|
||||
@@ -13,6 +14,14 @@ public class LevelLoadManager : MonoBehaviour
|
||||
|
||||
public bool isShowing => canvasGroup.alpha == 1;
|
||||
|
||||
[Header("Matchmade UI")]
|
||||
public GameObject matchmadeUI;
|
||||
public GameObject p1_red,p2_red,p1_blue,p2_blue;
|
||||
public Image p1_icon, p2_icon;
|
||||
public TMP_Text p1_name, p2_name;
|
||||
public TMP_Text p1_l10, p2_l10;
|
||||
public Sprite redIcon, blueIcon;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if(instance != null){
|
||||
@@ -24,6 +33,8 @@ public class LevelLoadManager : MonoBehaviour
|
||||
|
||||
DontDestroyOnLoad(gameObject);
|
||||
Hide();
|
||||
|
||||
matchmadeUI.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +49,11 @@ public class LevelLoadManager : MonoBehaviour
|
||||
IEnumerator CoroutineLoadLevel(string levelName){
|
||||
instance.Show();
|
||||
yield return new WaitForSeconds(transitionDuration);
|
||||
if(matchmadeUI.activeSelf){
|
||||
yield return new WaitForSeconds(3f);
|
||||
}
|
||||
yield return SceneManager.LoadSceneAsync(levelName);
|
||||
|
||||
instance.Hide();
|
||||
}
|
||||
|
||||
@@ -58,4 +73,32 @@ public class LevelLoadManager : MonoBehaviour
|
||||
canvasGroup.DOFade(0, transitionDuration).SetEase(Ease.InSine);
|
||||
contentImage.DOFillAmount(0, transitionDuration).SetEase(Ease.InSine);
|
||||
}
|
||||
|
||||
|
||||
public void SetupMatchMade(Team myTeam, string opponentName, string myName, string myL10, string opponentL10){
|
||||
matchmadeUI.SetActive(true);
|
||||
|
||||
if(myTeam == Team.Red){
|
||||
p1_red.SetActive(true);
|
||||
p1_blue.SetActive(false);
|
||||
p2_red.SetActive(false);
|
||||
p2_blue.SetActive(true);
|
||||
|
||||
p1_icon.sprite = redIcon;
|
||||
p2_icon.sprite = blueIcon;
|
||||
}else{
|
||||
p1_red.SetActive(false);
|
||||
p1_blue.SetActive(true);
|
||||
p2_red.SetActive(true);
|
||||
p2_blue.SetActive(false);
|
||||
|
||||
p1_icon.sprite = blueIcon;
|
||||
p2_icon.sprite = redIcon;
|
||||
}
|
||||
|
||||
p1_name.text = myName;
|
||||
p2_name.text = opponentName;
|
||||
p1_l10.text = myL10;
|
||||
p2_l10.text = opponentL10;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user