40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using BNG;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class EndGameModule : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private LeanSize _sphere;
|
|
[SerializeField]
|
|
private UITextShow _textTimer;
|
|
|
|
[SerializeField]
|
|
private UIPanel _uiPanel;
|
|
[SerializeField]
|
|
private UIPanel _timeOutPanel;
|
|
|
|
|
|
public void ShowEndMenu(bool success)
|
|
{
|
|
_sphere.LeanAction();
|
|
|
|
if (success)
|
|
_uiPanel.ShowPanel();
|
|
else
|
|
_timeOutPanel.ShowPanel();
|
|
|
|
if (success)
|
|
{
|
|
if (GlobalSettings.Instance.AllMaps)
|
|
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.ChangeLevel(); });
|
|
else
|
|
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.LoadStartScene(); });
|
|
}
|
|
else
|
|
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.LoadStartScene(); });
|
|
}
|
|
}
|