rabidus-test/Assets/Scripts/EndGameModule.cs

38 lines
1006 B
C#
Raw Normal View History

2023-08-22 15:41:12 +03:00
using BNG;
2023-08-15 17:38:54 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class EndGameModule : MonoBehaviour
{
2023-09-18 20:09:22 +03:00
[SerializeField]
private LeanSize _sphere;
2023-08-15 17:38:54 +03:00
[SerializeField]
2023-08-22 15:41:12 +03:00
private UITextShow _textTimer;
2023-08-15 17:38:54 +03:00
[SerializeField]
private UIPanel _uiPanel;
2023-10-13 14:13:44 +03:00
[SerializeField]
private UIPanel _timeOutPanel;
2023-08-15 17:38:54 +03:00
public void ShowEndMenu(bool success)
{
if (success)
2023-10-13 14:13:44 +03:00
_uiPanel.ShowPanel();
2023-08-15 17:38:54 +03:00
else
2023-10-13 14:13:44 +03:00
_timeOutPanel.ShowPanel();
2023-08-22 15:41:12 +03:00
2023-10-02 19:12:35 +03:00
if (success)
2023-10-10 17:25:59 +03:00
{
if (GlobalSettings.Instance.AllMaps)
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.ChangeLevel(); });
else
2023-10-11 11:58:06 +03:00
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.LoadStartScene(); });
2023-10-10 17:25:59 +03:00
}
2023-10-02 19:12:35 +03:00
else
2023-10-11 11:58:06 +03:00
_textTimer.ShowTimer(3, string.Empty, 0, null, () => { BNG.SceneLoader.Instance.LoadStartScene(); });
2023-08-15 17:38:54 +03:00
}
}