void Awake() { pauseScreen = GameObject.Find("Canvas_PauseScreen").GetComponent <Canvas>(); winScreen = GameObject.Find("Canvas_WinScreen").GetComponent <Canvas>(); failScreen = GameObject.Find("Canvas_FailScreen").GetComponent <Canvas>(); retryButton = GameObject.Find("Button_Retry").GetComponent <Button>(); continueButton = GameObject.Find("Button_Continue").GetComponent <Button>(); quitButton = GameObject.Find("Button_Quit").GetComponent <Button>(); healthBarP1 = GameObject.Find("HealthBar_P1").GetComponent <Slider>(); healthBarP2 = GameObject.Find("HealthBar_P2").GetComponent <Slider>(); healthBarP3 = GameObject.Find("HealthBar_P3").GetComponent <Slider>(); healthBarP4 = GameObject.Find("HealthBar_P4").GetComponent <Slider>(); playersManager = GetComponent <PlayersManager>(); hudParent = transform.GetComponentInChildren <HUDParent>(); }
public UIParent() { HUD = new HUDParent(); deathMenu = new Menu ( new Interfaces.Button[] { new Interfaces.Button ( new Rectangle(25, 100, 150, 50), new Restart(), Color.DarkRed, Color.Red, "Restart", 2 ) }, "You Died", Color.Red, new Vector2(10, 10), 3 ); EndOfLevel = new Menu ( new Interfaces.Button[] { new Interfaces.Button ( new Rectangle(25, 100, 150, 50), new NextLevel(), Color.DarkRed, Color.Red, "Next Level", 2 ) }, "You Completed the Level", Color.Red, new Vector2(10, 10), 3 ); MainMenu = new Menu ( new Interfaces.Button[] { new Interfaces.Button ( new Rectangle(25, 100, 150, 50), new NextLevel(), Color.DarkRed, Color.Red, "Start", 2 ), new Interfaces.Button ( new Rectangle(25, 160, 150, 50), new Exit(), Color.DarkRed, Color.Red, "Exit", 2 ), new Interfaces.Button ( new Rectangle(25, 220, 0, 0), new Empty(), Color.DarkRed, Color.Red, "Movement: arrow keys", 1 ), new Interfaces.Button ( new Rectangle(25, 260, 0, 0), new Empty(), Color.DarkRed, Color.Red, "Shooting: Numpad 0", 1 ) }, "Lost Lives", Color.Red, new Vector2(10, 10), 3 ); End = new Menu ( new Interfaces.Button[] { new Interfaces.Button ( new Rectangle(25, 100, 150, 50), new GotoMainMenu(), Color.DarkRed, Color.Red, "Main Menu", 2 ), new Interfaces.Button ( new Rectangle(25, 160, 150, 50), new Exit(), Color.DarkRed, Color.Red, "Exit", 2 ) }, "Thank you for playing!", Color.Red, new Vector2(10, 10), 3 ); }
private void Awake() { _instance = this; }