forked from ArztSamuel/Applying_EANNs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UIController.cs
52 lines (45 loc) · 1.23 KB
/
UIController.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
/// Author: Samuel Arzt
/// Date: March 2017
#region Includes
using UnityEngine;
using UnityEngine.UI;
#endregion
/// <summary>
/// Class for controlling the overall GUI.
/// </summary>
public class UIController : MonoBehaviour
{
#region Members
/// <summary>
/// The parent canvas of all UI elements.
/// </summary>
public Canvas Canvas
{
get;
private set;
}
private UISimulationController simulationUI;
private UIStartMenuController startMenuUI;
#endregion
#region Constructors
void Awake()
{
if (GameStateManager.Instance != null)
GameStateManager.Instance.UIController = this;
Canvas = GetComponent<Canvas>();
simulationUI = GetComponentInChildren<UISimulationController>(true);
startMenuUI = GetComponentInChildren<UIStartMenuController>(true);
simulationUI.Show();
}
#endregion
#region Methods
/// <summary>
/// Sets the CarController from which to get the data from to be displayed.
/// </summary>
/// <param name="target">The CarController to display the data of.</param>
public void SetDisplayTarget(CarController target)
{
simulationUI.Target = target;
}
#endregion
}