Пример #1
0
    // Start is called before the first frame update
    void OnTriggerStay(Collider other)
    {
        if (other.tag == "Elmo")
        {
            hub.OpenMessagePanel("Press F to talk");

            if (Input.GetKeyDown(KeyCode.F))
            {
                hub.CloseMessagePanel();
                elmoDialogue.SetActive(true);
                count += 1;
            }
        }

        if (other.tag == "Karen1")
        {
            hub.OpenMessagePanel("Press F to talk");

            if (Input.GetKeyDown(KeyCode.F))
            {
                hub.CloseMessagePanel();
                karenSpeech.SetActive(true);
                count += 1;
            }
        }

        if (other.tag == "Karen2")
        {
            hub.OpenMessagePanel("Press F to talk");

            if (Input.GetKeyDown(KeyCode.F))
            {
                notes.AddTextKaren(0);
                hub.CloseMessagePanel();
                karenSpeech.SetActive(true);
                karenDialogue.zen = true;
            }
        }



        if (other.tag == "Zen1")
        {
            hub.OpenMessagePanel("Press F to talk");

            if (Input.GetKeyDown(KeyCode.F))
            {
                hub.CloseMessagePanel();
                zenSpeech.SetActive(true);
                count += 1;
            }
        }

        if (other.tag == "Zen2")
        {
            hub.OpenMessagePanel("Press F to talk");

            if (Input.GetKeyDown(KeyCode.F))
            {
                notes.AddTextZen(0);
                hub.CloseMessagePanel();
                zenSpeech.SetActive(true);
                zenDialogue.zen = true;
                interview       = true;
            }
        }

        if (other.tag == "Pablo1")
        {
            hub.OpenMessagePanel("Press F to talk");

            if (Input.GetKeyDown(KeyCode.F))
            {
                hub.CloseMessagePanel();
                pabloSpeech.SetActive(true);
                count += 1;
            }
        }

        if (other.tag == "Pablo2")
        {
            hub.OpenMessagePanel("Press F to talk");

            if (Input.GetKeyDown(KeyCode.F))
            {
                notes.AddTextPablo(0);
                notes.AddTextPablo(2);
                notes.AddTextPablo(3);
                hub.CloseMessagePanel();
                pabloSpeech.SetActive(true);
                pabloDialogue.zen = true;
                notes.AddTextLock(3);
            }
        }


        if (other.tag == "FootPrints")
        {
            hub.OpenMessagePanel("Examine Clue");

            if (Input.GetKeyDown(KeyCode.F))
            {
                notes.AddTextKaren(1);
                notes.AddTextKaren(2);
                notes.AddTextKaren(3);
                hub.CloseMessagePanel();
                innerMonologue.clues = true;
                inspectSteps         = true;

                foreach (GameObject clueprint in cluesList)
                {
                    clueprint.GetComponent <BoxCollider>().enabled = false;
                }
            }
        }

        IInventoryItem item = other.GetComponent <IInventoryItem>();

        IInventoryItem currentItem = null;


        if (item != null && other.tag == "Door")
        {
            hub.OpenMessagePanel("Press F to open door");

            if (Input.GetKeyDown(KeyCode.F))
            {
                item.OnUse();
                other.GetComponent <BoxCollider>().enabled = false;
                hub.CloseMessagePanel();
            }
        }

        if (item != null && other.tag == "LivingRoomDoor")
        {
            if (count >= 4)
            {
                hub.OpenMessagePanel("Press f to open");

                if (Input.GetKeyDown(KeyCode.F))
                {
                    item.OnUse();
                    other.GetComponent <BoxCollider>().enabled = false;
                    hub.CloseMessagePanel();
                }
            }

            else
            {
                hub.OpenMessagePanel("Speak to your friends first!!");
            }
        }


        if (item != null && other.tag == "ZamazonKit")
        {
            hub.OpenMessagePanel("Press F to obtain Zamazon Kit!!");

            trigger.GetComponent <BoxCollider>().enabled = true;
            doorClosed = true;

            if (Input.GetKeyDown(KeyCode.F))
            {
                notes.AddTextLock(0);
                hub.CloseMessagePanel();
                vc.ToggleKit(false);
                vc.InventoryIsActive = true;
                Destroy(other.gameObject);
                investigationStartTrigger.SetActive(true);
                GameObject.FindWithTag("Zen1").tag   = "Zen2";
                GameObject.FindWithTag("Pablo1").tag = "Pablo2";
                GameObject.FindWithTag("Karen1").tag = "Karen2";
                ElmoMonologueTrigger.SetActive(true);
                innerMonologue.zen = true;
                Destroy(ElmoAlive);
                Destroy(Karen);
                Instantiate(Elmo);
                Instantiate(KarenAfterDeath);
            }
        }

        if (vc.InventoryIsActive == true)
        {
            book = GameObject.Find("ZenDiaryFake");

            if (item != null && other.gameObject == book)
            {
                hub.OpenMessagePanel("Press F to pick up");

                if (Input.GetKeyDown(KeyCode.F))
                {
                    notes.AddTextZen(1);

                    innerMonologue.GoToZenRoom = true;


                    inventory.AddItem(item);
                    item.OnPickup();
                }
            }
            ///////////////////////////////////

            if (item != null && other.tag == "RealDiary")
            {
                hub.OpenMessagePanel("Press F to pick up");

                if (Input.GetKeyDown(KeyCode.F))
                {
                    innerMonologue.Suspects = true;

                    notes.AddTextZen(3);

                    inventory.AddItem(item);
                    item.OnUse();
                }
            }

            if (item != null && other.tag == "Pickable")
            {
                hub.OpenMessagePanel("Press F to pick up");

                if (Input.GetKeyDown(KeyCode.F))
                {
                    inventory.AddItem(item);
                    item.OnPickup();
                }
            }

            if (item != null && other.tag == "Touchable")
            {
                hub.OpenMessagePanel("Press f to use");
                if (Input.GetKeyDown(KeyCode.F))
                {
                    item.OnUse();
                }
            }

            if (item != null && other.tag == "Clues")
            {
                hub.OpenMessagePanel("Press f to inspect clue");
                if (Input.GetKeyDown(KeyCode.F))
                {
                    item.OnUse();
                }
            }

            if (item != null && other.tag == "Exit" && vc.InventoryIsActive)
            {
                hub.OpenMessagePanel("Press F to open door");

                if (Input.GetKeyDown(KeyCode.F))
                {
                    innerMonologue.storage = true;
                    inspectDoor            = true;
                }
            }

            if (item != null && other.tag == "PictureClues")
            {
                hub.OpenMessagePanel("Press F to pick up");

                if (Input.GetKeyDown(KeyCode.F))
                {
                    notes.AddTextLock(1);
                    inventory.AddItem(item);
                    item.OnPickup();

                    GameObject iitem = GameObject.Find(item.Name);
                    iitem.GetComponent <SpriteRenderer>().enabled = true;

                    Destroy(other);

                    hub.OpenMessagePanel("");
                }
            }

            if (inspectDoor && inspectSteps && getPoison && interview)
            {
                notes.AddTextPablo(1);
                notes.AddTextLock(2);
                DoorLivingRoom.GetComponent <Animator>().SetBool("DoorOpen", true);
                doorOpen = true;
                Book.SetActive(true);
                ZenRoomTrigger.SetActive(true);

                GameObject.FindWithTag("Karen2")
                .GetComponent <Animator>().SetBool("Disappear", true);
            }
        }
    }
Пример #2
0
    public void ChangeTexts()
    {
        if (zen)
        {
            panel.SetActive(true);
            sentences        = zenRoomSentences;
            index            = -1;
            textDisplay.text = "";
            zen = false;
        }

        if (kitSpeech)
        {
            panel.SetActive(true);
            sentences        = kitSpeechSentences;
            index            = -1;
            textDisplay.text = "";
            kitSpeech        = false;
        }

        if (investigationStart)
        {
            panel.SetActive(true);
            sentences          = investigationStartSentences;
            index              = -1;
            textDisplay.text   = "";
            investigationStart = false;
        }

        if (bloodMessage)
        {
            panel.SetActive(true);
            sentences        = bloodClueSentences;
            index            = -1;
            textDisplay.text = "";
            bloodMessage     = false;
            notes.AddTextElmo(0);
        }

        if (bloodMessageInspect)
        {
            panel.SetActive(true);
            sentences           = bloodInspectSentences;
            index               = -1;
            textDisplay.text    = "";
            bloodMessageInspect = false;
            notes.AddTextElmo(0);
            notes.AddTextElmo(1);
            notes.AddTextElmo(2);
            notes.AddTextElmo(3);
        }

        if (zenMirror)
        {
            panel.SetActive(true);
            sentences = mirrorSentences;
            notes.AddTextZen(2);
            index            = -1;
            textDisplay.text = "";
            zenMirror        = false;
        }


        if (GoToZenRoom)
        {
            panel.SetActive(true);
            sentences        = GoToZenSentence;
            index            = -1;
            textDisplay.text = "";
            GoToZenRoom      = false;
        }

        if (storage)
        {
            panel.SetActive(true);
            sentences        = storageSentences;
            index            = -1;
            textDisplay.text = "";
            storage          = false;
        }

        if (final)
        {
            panel.SetActive(true);
            sentences        = finalSentences;
            index            = -1;
            textDisplay.text = "";
            final            = false;
        }

        if (KarenSuspicion)
        {
            panel.SetActive(true);
            sentences        = KarenSuspicionSentences;
            index            = -1;
            textDisplay.text = "";
            KarenSuspicion   = false;
        }

        if (Suspects)
        {
            panel.SetActive(true);
            sentences        = suspectsSentences;
            index            = -1;
            textDisplay.text = "";
            StorageEnd       = true;
            Suspects         = false;
        }

        if (clues)
        {
            panel.SetActive(true);
            sentences        = cluesSentences;
            index            = -1;
            textDisplay.text = "";
            clues            = false;
        }
    }