private void Update() { if (inCollider) { if (Input.GetKeyDown("e") && player != null && player.getBots() > 0) { bot.SetActive(true); controller.powerCheck(); } if (Input.GetKeyDown("e") && self.activeSelf) { bot.SetActive(false); controller.powerCheck(); } } }
void ExitConditions(Collider c) { if (c.tag.Equals("Player")) { BotCollector playerInventory = c.GetComponent <BotCollector>(); if (playerInventory.getBots() == numBots) { StartCoroutine(ExitScene()); } else { TipPanel.GetInstance().SetText("You're missing bots."); TipPanel.GetInstance().SetVisible(true); } } }
// Update is called once per frame void Update() { if (inCollider) { if (Input.GetKeyDown("e") && player != null && player.getBots() >= botsNeeded && !container.getIsBuilt() && !container.getIsBuilding()) { container.setIsBuilding(true); StartCoroutine(delayedBuild()); } if (Input.GetKeyDown("e") && buildObject.activeSelf) { deactivatePlatform(player); deactivateSwitch(player); } } }