Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (isActive)
        {
            dialogManager.setRoom("room_2");
            player.setRoom("room_2");

            switch (eventCounter)
            {
            case 0:
                dialogManager.setDialog("conversationWithFire.txt");
                eventCounter++;
                break;

            case 1:
                //Debug.Log ("Dialog still running: "+dialogManager.isActive());
                if (!dialogManager.isActive())
                {
                    eventCounter++;
                }

                break;


            case 2:
                Debug.Log("I'm here :>");

                /*dialogManager.setDialog ("areYouAngry.txt");
                 * if(dialogManager.getDialogOutput()=="selfIsCalm"){
                 *      eventCounter++;
                 *      player.unfreeze ();
                 * }*/
                eventCounter++;
                break;

            case 3:
                exitDoor.setIsLocked();
                roomSolved = true;
                eventCounter++;
                break;

            case 4:
                break;
            }



            if (roomSolved)
            {
                if (exitDoor.isLocked())
                {
                    //File.Delete("dialog/room_2/ItemHolder.txt");
                    r2Dark         = GameObject.Find("raum2D").GetComponent <SpriteRenderer>();
                    r2Dark.enabled = true;
                    r1Dark         = GameObject.Find("raum3D").GetComponent <SpriteRenderer>();
                    r1Dark.enabled = false;
                    endAndProceed();
                }
            }
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (isActive)
        {
            dialogManager.setRoom("room_1");
            player.setRoom("room_1");


            switch (eventCounter)
            {
            case 0:
                //dialogManager.setDialog ("Lala lulu!");
                //player.freeze();

                dialogManager.setDialog("contrastEncounter.txt");
                eventCounter++;
                break;

            case 1:

                if (scaryPainting.interactionOccurred())
                {
                    dialogManager.setDialog("scaryPainting_firstLook.txt");
                    eventCounter++;
                }

                break;


            case 2:
                if (beautifulPainting.interactionOccurred())
                {
                    //Debug.Log ("Dialog running: "+dialogManager.isActive());
                    dialogManager.setDialog("beautifulPainting_firstLook.txt");
                    //Debug.Log ("...and running: "+dialogManager.isActive());
                    eventCounter++;
                }

                break;

            case 3:
                //Debug.Log ("Dialog still running: "+dialogManager.isActive());
                if (!dialogManager.isActive())
                {
                    eventCounter++;
                }
                break;

            case 4:
                if (beautifulPainting.interactionOccurred())
                {
                    //Debug.Log ("Dialog running: "+dialogManager.isActive());
                    dialogManager.setDialog("beautifulPainting_secondLook.txt");
                    //Debug.Log ("...and running: "+dialogManager.isActive());
                    eventCounter++;
                }
                break;

            case 5:
                //Debug.Log ("Dialog still running: "+dialogManager.isActive());
                if (!dialogManager.isActive())
                {
                    eventCounter++;
                }
                break;

            case 6:
                if (beautifulPainting.interactionOccurred())
                {
                    //Debug.Log ("Dialog running: "+dialogManager.isActive());
                    dialogManager.setDialog("beautifulPainting_thirdLook.txt");
                    //Debug.Log ("...and running: "+dialogManager.isActive());
                    eventCounter++;
                }
                break;


            case 7:
                //Debug.Log ("Dialog still running: "+dialogManager.isActive());
                if (!dialogManager.isActive())
                {
                    eventCounter++;
                }
                break;


            case 8:
                if (beautifulPainting.interactionOccurred())
                {
                    //Debug.Log ("Dialog running: "+dialogManager.isActive());
                    dialogManager.setDialog("beautifulPainting_fourthLook.txt");
                    //Debug.Log ("...and running: "+dialogManager.isActive());
                    eventCounter++;
                }
                break;

            case 9:
                //Debug.Log ("Dialog still running: "+dialogManager.isActive());
                if (!dialogManager.isActive())
                {
                    eventCounter++;
                }
                break;

            case 10:
                if (beautifulPainting.interactionOccurred())
                {
                    //Debug.Log ("Dialog running: "+dialogManager.isActive());
                    dialogManager.setDialog("inDenial.txt");
                    //Debug.Log ("...and running: "+dialogManager.isActive());
                    eventCounter++;
                }
                break;

            case 11:
                //Debug.Log ("Dialog still running: "+dialogManager.isActive());
                if (!dialogManager.isActive())
                {
                    eventCounter++;
                }
                break;

            case 12:
                if (beautifulPainting.interactionOccurred())
                {
                    //Debug.Log ("Dialog running: "+dialogManager.isActive());
                    dialogManager.setDialog("finalChoice.txt");
                    //Debug.Log ("...and running: "+dialogManager.isActive());
                }
                if (dialogManager.getDialogOutput() == "paintingBeingRipped")
                {
                    eventCounter++;
                }
                break;


            case 13:
                eventCounter++;
                break;

            case 14:
                //dialogManager.setDialog ("talkingToSomeone.txt");
                //if(!dialogManager.isActive()){eventCounter++;}
                eventCounter++;
                break;



            case 15:
                beautifulPainting.ripPainting();
                exitDoor.setIsLocked();                 //exitDoor locked=false!! (unlock)
                roomSolved = true;
                eventCounter++;

                break;
            }



            if (roomSolved)
            {
                if (exitDoor.isLocked())
                {
                    File.Delete("dialog/room_1/ItemHolder.txt");
                    r2Dark         = GameObject.Find("raum2D").GetComponent <SpriteRenderer>();
                    r2Dark.enabled = false;
                    r1Dark         = GameObject.Find("raum1D").GetComponent <SpriteRenderer>();
                    r1Dark.enabled = true;
                    endAndProceed();
                }
            }
        }
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        //Debug.Log ("THis is gameobject: " + NPC2.transform.name);
        //Debug.Log (dialogManager.getDialogOutput ());

        if (isActive)
        {
            dialogManager.setRoom("room_P");
            player.setRoom("room_P");

            switch (eventCounter)
            {
            case 0:
                //NPC2.SetActive (false);
                npc.moveTo(0f, -0.33f);
                eventCounter++;
                break;

            case 1:

                if (event1.getColliderStateEnter() == true)
                {
                    player.freeze();
                    dialogManager.setDialog("First_Meeting.txt");
                }

                if (dialogManager.getDialogOutput() == "npcmove")
                {
                    npc.moveRelative(0f, -3.5f);
                    eventCounter++;
                }


                break;


            case 2:
                dialogManager.setDialog("Next_Step.txt");
                if (dialogManager.isActive() == false)
                {
                    //Debug.Log ("IM HERE");
                    eventCounter++;
                }
                break;

            case 3:
                NPC2.enabled = true;
                dialogManager.setDialog("Final.txt");
                if (dialogManager.getDialogOutput() == "falling")
                {
                    aDark                = GameObject.Find("anfangsraumD").GetComponent <SpriteRenderer> ();
                    aDark.enabled        = false;
                    wasRead              = true;
                    playerCamera.enabled = false;
                    npcCamera.enabled    = true;
                    //falling (victim.transform.position.x,-10.5f);
                    float tempLocX  = npc_object.transform.position.x;
                    float tempLocY  = npc_object.transform.position.y;
                    float tempSizeX = npc_object.transform.localScale.x;
                    float tempSizeY = npc_object.transform.localScale.y;

                    fallingState = true;

                    if (fallingState)
                    {
                        if (npc_object.transform.position.y > -10.8f)
                        {
                            speed    += 9.82f * Time.deltaTime;
                            tempLocY  = npc_object.transform.position.y - 0.1f * Time.deltaTime * speed;
                            tempSizeX = npc_object.transform.localScale.x - 0.015f * Time.deltaTime;
                            tempSizeY = npc_object.transform.localScale.y - 0.015f * Time.deltaTime;
                        }


                        npc_object.transform.position   = new Vector3(tempLocX, tempLocY, 0f);
                        npc_object.transform.localScale = new Vector3(tempSizeX, tempSizeY, 1f);
                        if (npc_object.transform.position.y <= -10.8f)
                        {
                            npcSprite.enabled    = false;
                            npcAnimation.enabled = false;
                            eventCounter++;
                        }
                    }
                }


                break;

            case 4:
                float tempY = npcCamera.transform.position.y - Time.deltaTime;
                npcCamera.transform.position = new Vector3(npcCamera.transform.position.x, tempY, npcCamera.transform.position.z);
                if (tempY <= -12.5f)
                {
                    eventCounter++;
                }
                break;

            case 5:

                delay -= Time.deltaTime;
                if (delay <= 0)
                {
                    SceneManager.LoadScene("the_end");
                    roomSolved = true;
                }
                break;
            }



            if (roomSolved)
            {
                File.Delete("dialog/room_P/ItemHolder.txt");
                endAndProceed();
            }
        }
    }
Exemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        if (isActive)
        {
            dialogManager.setRoom("room_3");
            player.setRoom("room_3");

            switch (eventCounter)
            {
            case 0:
                if (event1.getColliderStateEnter())
                {
                    player.freeze();

                    if (player.getFirstItem() != null)
                    {
                        //Debug.Log ("FirstIsntHere");
                        dialogManager.setDialog("someitems.txt");
                        firstTime = false;
                    }
                    else if (firstTime)
                    {
                        dialogManager.setDialog("noitems.txt");
                    }
                    else
                    {
                        dialogManager.setDialog("lostitems.txt");
                        eventCounter++;
                    }
                }
                if (dialogManager.getDialogOutput() == "falling")
                {
                    collider.enabled = false;
                    if (timeCounter < 2f)
                    {
                        tempPlanken = planken.transform.position.y + Time.deltaTime * 2f;

                        planken.transform.position = new Vector3(planken.transform.position.x, tempPlanken, planken.transform.position.z);
                    }

                    if (timeCounter > .5f && (spieler.transform.position.y > 14))
                    {
                        tempPlanken = spieler.transform.position.y - Time.deltaTime * 1f;

                        spieler.transform.position = new Vector3(spieler.transform.position.x, tempPlanken, spieler.transform.position.z);

                        tempPlanken = spieler.transform.localScale.y - 0.05f * Time.deltaTime;

                        spieler.transform.localScale = new Vector3(tempPlanken, tempPlanken, 1f);
                    }

                    if (timeCounter > 1.5f && timeCounter < 3.5f)
                    {
                        tempPlanken = planken.transform.position.y - Time.deltaTime * 2f;

                        planken.transform.position = new Vector3(planken.transform.position.x, tempPlanken, planken.transform.position.z);
                    }
                    else if (timeCounter > 3.5f)
                    {
                        spieler.transform.localScale = new Vector3(0.025f, 0.025f, 1f);
                        timeCounter = 0f;
                        player.setSpeed(1f);
                        collider.enabled = true;
                        //player.unfreeze ();
                        dialogManager.setDialogOutputTo("");
                    }

                    timeCounter += Time.deltaTime;
                }
                if (dialogManager.getDialogOutput() == "delete")
                {
                    player.deleteIventory();
                }
                if (dialogManager.getDialogOutput() == "endDialog")
                {
                    //Debug.Log ("endDialog = true");
                    endDialog = true;
                }

                if (dialogManager.getDialogOutput() == "unfreeze")
                {
                    player.unfreeze();
                    dialogManager.setDialogOutputTo("");
                }
                if (dialogManager.isActive() == false && endDialog)
                {
                    eventCounter++;
                }



                break;

            case 1:
                player.unfreeze();
                eventCounter++;

                break;


            case 2:
                eventCounter++;

                break;

            case 3:

                exitDoor.setIsLocked();                 //exitDoor locked=false!! (unlock)
                roomSolved = true;
                eventCounter++;
                break;

            case 4:
                break;
            }



            if (roomSolved)
            {
                if (exitDoor.isLocked())
                {
                    File.Delete("dialog/room_3/ItemHolder.txt");
                    r4Dark         = GameObject.Find("raum4D").GetComponent <SpriteRenderer>();
                    r4Dark.enabled = false;
                    r3Dark         = GameObject.Find("raum3D").GetComponent <SpriteRenderer>();
                    r3Dark.enabled = true;
                    //audio.GetComponent<AudioSource> ().Stop ();
                    endAndProceed();
                }
            }
        }
    }