// Allows the player to spawn units with HUD void RunSpawnUnitsButtons() { if (PlayerHasLost || SelectedBarracks == null) { UIButtons.SetActive(false); } else { UIButtons.SetActive(true); UIKnight.onClick.AddListener(SpawnKnightButton); UIArcher.onClick.AddListener(SpawnArcherButton); UIPikeman.onClick.AddListener(SpawnPikemanButton); UIWizard.onClick.AddListener(SpawnWizardButton); } if (Input.GetKey(KeyCode.LeftShift)) { UIButtonPrompt.SetActive(false); UIKnight.gameObject.SetActive(true); UIArcher.gameObject.SetActive(true); UIPikeman.gameObject.SetActive(true); UIWizard.gameObject.SetActive(true); } else { UIButtonPrompt.SetActive(true); UIKnight.gameObject.SetActive(false); UIArcher.gameObject.SetActive(false); UIPikeman.gameObject.SetActive(false); UIWizard.gameObject.SetActive(false); } }