//Door control depending on the button action and button state opens or closes the doors public void DoorControl() { if (click.buttonState == true && isNotEmpty == true && isCorrect == true) { doors.Open(true); } if (click.buttonState == true && isNotEmpty == true) { doors.Open(false); } else if (click.buttonState == false || isNotEmpty == false) { doors.Close(); } if (click.clickAmount == correctAmount && notCounting == false) { doors.Open(true); } if (click.clickAmount > 0 && notCounting == false) { doors.Open(false); } else if (notCounting == false) { doors.Close(); } }
void HardwireButton() { explodeButton.onClick.RemoveListener(ExplodeButton); hardwireButton.onClick.RemoveListener(HardwireButton); hackButton.onClick.RemoveListener(HackButton); cancelButton.onClick.RemoveListener(CancelButton); explodeButtonObj.SetActive(false); hardwireButtonObj.SetActive(false); hackButtonObj.SetActive(false); cancelButtonObj.SetActive(false); //FindObjectOfType<Interact>().DoneInteracting(); openDoor.Open(); }
// Calls for door opening depending on the supplied objects void DoorControl() { if (Count == correctAmount || isCorrect == true) { doors.Open(true); } else if (Count > 0) { doors.Open(false); } else { doors.Close(); } }
void OnTriggerEnter2D(Collider2D other) { if (other.GetComponent <PlayerController> () != null) { if (!isEquipment && !isHpRegen) { ScoreManager.AddPoints(pointsToAdd); } if (isEquipment) { eq.AddItem(); door.isOpened = true; door.Open(); } if (isHpRegen) { HealthManager.playerHp++; } if (isLifeUp) { life.GiveLife(); } pickedItemSoundEffect.Play(); Destroy(gameObject); } }
public void MouthButton() { for (int i = 0; i < optionsImages.Length; i++) { optionsImages[i].CrossFadeAlpha(0, 0.25f, false); showingMenu = false; } if (currentItem != null) { DialogueManager.Instance.StartDialogue(currentItem.Mouth, currentItem.VoiceOversMouth); } if (currentDoor != null) { DialogueManager.Instance.StartDialogue(currentDoor.Mouth, currentDoor.VoiceOversMouth); } if (currentGhost != null && GhostInteraction.Saveable) { DialogueManager.Instance.StartDialogue(currentGhost.MouthSaveable, currentGhost.VoiceOversSaveable); currentGhost.Ghost.material = currentGhost.Happy; foreach (ParticleSystem p in currentGhost.Tears) { p.Stop(); } StartCoroutine(door.Open(openDoor.transform.rotation)); } else if (currentGhost != null) { DialogueManager.Instance.StartDialogue(currentGhost.Mouth, currentGhost.VoiceOversMouth); } currentItem = null; currentGhost = null; currentDoor = null; }
public void Unlock() { if (AllUnlocksDone()) { tile.moldProof = false; open.Open(); } }
void OnTriggerEnter2D(Collider2D c) { if (c.tag == "Player") { if (!activated) { // Local position //finalLevel.moveArrow(new Vector3(0, -1.0f, 0)); door.Open(doorOpenUpperBound, doorOpenLowerBound, speed, waitTime); activated = true; //gameObject.SetActive(false); } } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Door")) { cout += 1; OpenDoor openDoor = collision.gameObject.GetComponent <OpenDoor>(); openDoor.Open(); } else if (collision.gameObject.CompareTag("TalkNPC")) { temp = collision.gameObject; SimpleTalkNPC simpleTalkNPC = collision.gameObject.GetComponent <SimpleTalkNPC>(); simpleTalkNPC.Talk(this); } }
public void Open() { m_cOpenDoor.Open(); }