Exemple #1
0
 //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();
     }
 }
Exemple #2
0
 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();
 }
Exemple #3
0
 // 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();
     }
 }
Exemple #4
0
    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);
        }
    }
Exemple #5
0
 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;
 }
Exemple #6
0
 public void Unlock()
 {
     if (AllUnlocksDone())
     {
         tile.moldProof = false;
         open.Open();
     }
 }
Exemple #7
0
 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);
         }
     }
 }
Exemple #8
0
    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);
        }
    }
Exemple #9
0
 public void Open()
 {
     m_cOpenDoor.Open();
 }