forked from PeterQStarlord/Core-Rescue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GamePanelManager.cs
66 lines (59 loc) · 1.73 KB
/
GamePanelManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class GamePanelManager : MonoBehaviour {
public GameObject m_playerOneHealthPanel = null;
public GameObject m_playerTwoHealthPanel = null;
public GameObject m_menuPanel = null;
public GameObject m_gameOverPanel = null;
// Update is called once per frame
void Update () {
if ( GameController.sGameEnded )
{
if( m_gameOverPanel != null )
{
m_gameOverPanel.SetActive(true);
}
if (m_menuPanel != null)
{
m_menuPanel.SetActive(false);
}
}
else if( !GameController.sGameStarted )
{
if( m_menuPanel != null )
{
m_menuPanel.SetActive(true);
}
if (m_gameOverPanel != null)
{
m_gameOverPanel.SetActive(false);
}
}
else
{
if( GameController.sActivePlayers.ContainsKey(0))
{
if (m_playerOneHealthPanel)
{
m_playerOneHealthPanel.SetActive(true);
}
}
if (GameController.sActivePlayers.ContainsKey(1))
{
if (m_playerTwoHealthPanel)
{
m_playerTwoHealthPanel.SetActive(true);
}
}
if (m_menuPanel != null)
{
m_menuPanel.SetActive(false);
}
if (m_gameOverPanel != null)
{
m_gameOverPanel.SetActive(false);
}
}
}
}