public void deactivatePlatform(BotCollector playerBotCollector) { container.setIsBuilt(false); buildObject.SetActive(false); ArrayList botIndices = container.GetBotsList(); // offset the vertical position to accomidate bot height Vector3 targetPosition = new Vector3(transform.position.x, transform.position.y + 0.5f, transform.position.z); playerBotCollector.RegainBots(botIndices.Count, botIndices, targetPosition, isSwitch); }
private void OnTriggerEnter(Collider c) { if (c.gameObject.CompareTag("Player")) { BotCollector player = c.gameObject.GetComponent <BotCollector>(); if (player != null) { inCollider = true; overlayScript.setActivePunchPrompt(true); } } }
public void deactivateSwitch(BotCollector player) { if (isSwitch) { Material noCurrent = Resources.Load("NoCurrent") as Material; foreach (GameObject wire in wireWithotWithoutCurrent) { wire.GetComponent <MeshRenderer>().material = noCurrent; } bot.SetActive(false); } }
private void OnTriggerExit(Collider other) { if (other.gameObject.CompareTag("Player")) { player = null; if (padLight != null) { padLight.enabled = false; } inCollider = false; overlayScript.setActiveButtonPrompt(false, botsNeeded); } }
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); } } }
private void Activate(Collider other) { if (other.gameObject.CompareTag("Player")) { player = other.gameObject.GetComponent <BotCollector>(); if (player != null) { if (padLight != null) { padLight.enabled = true; } inCollider = true; overlayScript.setActiveButtonPrompt(true, botsNeeded); } } }
void OnTriggerEnter(Collider c) { if (c.gameObject.CompareTag("Player") && c.attachedRigidbody != null) { //NOTE: inventory script was deleted if more problems arise. This is what we changed //InventoryScript invent = c.attachedRigidbody.gameObject.GetComponent<InventoryScript>(); if (/*invent != null &&*/ botMode == BotMode.Idle) { botMode = BotMode.Follow; anim.SetBool("BootUp", true); BotCollector bc = c.attachedRigidbody.gameObject.GetComponent <BotCollector>(); if (bc != null) { bc.ReceiveBots(1, transform.gameObject); } followTarget = c.attachedRigidbody.transform; //invent.AddBot(); } } else if (c.gameObject.CompareTag("BotPart") && botMode == BotMode.Follow) { BotPart botPart = c.GetComponent <BotPart>(); if (botPart != null) { GameObject bot = botPart.GetParentBot(); if (bot != null) { BotMovement botScript = bot.GetComponent <BotMovement>(); if (botScript != null) { BumpBot(botScript); } } } } }
// Resets the space to be ready for next enter private void OnTriggerExit(Collider other) { player = null; inCollider = false; }