Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        tiempo          -= Time.deltaTime;
        tiempoAnimacion -= Time.deltaTime;

        if (tiempoAnimacion < 0 && tomaHojas)
        {
            if (playerAnimator != null)
            {
                playerAnimator.SetBool("recojer", false);
                transform.position      = new Vector3(-10, -10, -10);
                MoverMouse.movimiento   = true;
                MoverMouse.cambioCamara = false;
                if (actualizar && General.paso_mision == 5 && General.misionActual[0] == "1")
                {
                    Misiones mision = Camera.main.gameObject.GetComponent <Misiones>();
                    gameObject.GetComponent <MeshRenderer> ().enabled = false;
                    gameObject.GetComponent <BoxCollider> ().enabled  = false;
                    mision.procesoMision1(General.paso_mision);
                    actualizar = false;
                }
            }
        }
        if (tiempo < 0)
        {
            tomaHojas = false;
        }
        if (General.misionActual[0] == "1" && General.paso_mision == 5)
        {
            gameObject.GetComponent <MeshRenderer>().enabled = true;
            gameObject.GetComponent <LensFlare>().enabled    = true;
        }
        else if (General.paso_mision > 5 && General.misionActual[0] == "1")
        {
            if (playerAnimator != null)
            {
                playerAnimator.SetBool("recojer", false);
            }
            Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
            maleta.agregarTextura(hoja);
            maleta.agregarTextura(hoja);
            Destroy(gameObject);
        }
        else if (General.paso_mision == 1 && General.misionActual[0] == "1")
        {
            gameObject.GetComponent <MeshRenderer>().enabled = false;
            gameObject.GetComponent <LensFlare>().enabled    = false;
        }
    }
Beispiel #2
0
    public void OnTriggerEnter(Collider colision)
    {
        if (colision.tag == "Player" && General.paso_mision == 2)
        {
            Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
            maleta.agregarTextura(hoja);
            maleta.agregarTextura(hoja);

            playerAnimator = colision.gameObject.GetComponent <Animator>();
            playerAnimator.SetBool("recojer", true);
            tiempoAnimacion = recojerAnimacion.length;

            Destroy(gameObject, 5);

            tiempo                  = 5;
            tiempoAnimacion         = recojerAnimacion.length;
            MoverMouse.movimiento   = false;
            MoverMouse.cambioCamara = true;
            tomaHojas               = true;

            actualizar = true;
        }
    }
Beispiel #3
0
    void prepararMaleta(Maleta maleta)
    {
        if (General.misionActual [0] == "2" && General.paso_mision <= 5 && !maleta.estaTextura(tributo.name))
        {
            maleta.agregarTextura(tributo);
        }
        else if (General.misionActual [0] == "2" && General.paso_mision == 6 && !maleta.estaTextura(certificado.name))
        {
            maleta.agregarTextura(certificado);
            if (maleta.estaTextura(tributo.name))
            {
                maleta.eliminarTextura(tributo.name);
            }
        }
        else if (General.misionActual [0] == "2" && General.paso_mision == 7 && !maleta.estaTextura(llave.name))
        {
            maleta.agregarTextura(llave);
            if (maleta.estaTextura(certificado.name))
            {
                maleta.eliminarTextura(certificado.name);
            }
            if (maleta.estaTextura(tributo.name))
            {
                maleta.eliminarTextura(tributo.name);
            }
        }
        else if (General.misionActual [0] == "3" && General.paso_mision >= 4 && !maleta.estaTextura(cruz.name))
        {
            maleta.agregarTextura(cruz);
        }
        else if (General.misionActual [0] == "3" && General.paso_mision == 5 && !maleta.estaTextura(articulos.name))
        {
            maleta.agregarTextura(articulos);
        }
        else if (General.misionActual [0] == "3" && General.paso_mision == 6 && !maleta.estaTextura(titulo.name))
        {
            maleta.agregarTextura(titulo);

            if (maleta.estaTextura(articulos.name))
            {
                maleta.eliminarTextura(articulos.name);
            }
        }
        else if (General.misionActual [0] == "3" && General.paso_mision == 7 && !maleta.estaTextura(llave.name))
        {
            maleta.agregarTextura(llave);
            if (maleta.estaTextura(titulo.name))
            {
                maleta.eliminarTextura(titulo.name);
            }
        }
    }
Beispiel #4
0
    // Update is called once per frame
    void Update()
    {
        tiempo          -= Time.deltaTime;
        tiempoAnimacion -= Time.deltaTime;
        if (tiempo < 0)
        {
            tomaMadera = false;
        }
        if (tiempoAnimacion < 0)
        {
            if (playerAnimator != null)
            {
                playerAnimator.SetBool("recojer", false);
                transform.position      = new Vector3(-10, -10, -10);
                MoverMouse.movimiento   = true;
                MoverMouse.cambioCamara = false;
                if (actualizar && General.paso_mision == 1 && General.misionActual[0] == "1")
                {
                    Misiones mision = Camera.main.gameObject.GetComponent <Misiones>();
                    mision.procesoMision1(General.paso_mision);
                    actualizar = false;
                }
            }
        }

        if (General.misionActual[0] == "1" && General.paso_mision == 1)
        {
        }
        else
        {
            if (General.paso_mision != 1 && General.misionActual[0] == "1")
            {
                Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
                maleta.agregarTextura(madera);
            }
            if (playerAnimator != null)
            {
                playerAnimator.SetBool("recojer", false);
            }

            Destroy(gameObject);
        }
    }
Beispiel #5
0
    // Update is called once per frame
    void Update()
    {
        if (instanciarVasija)
        {
            GameObject vasijaIns = (GameObject)Instantiate(vasija, player.transform.position, transform.rotation);
            vasijaIns.transform.parent = player.transform;
            vasijaIns.transform.Translate(0.1532699f, -0.3859406f, 0f);
            vasijaIns.transform.rotation = new Quaternion();
            vasijaIns.transform.Rotate(270f, 0f, 0f);
            instanciarVasija = false;
        }

        tiempo          -= Time.deltaTime;
        tiempoAnimacion -= Time.deltaTime;
        if (tiempo < 0)
        {
            if (GameObject.Find("Vasija(Clone)"))
            {
                playerAnimator.SetBool("recojer", false);
                Destroy(GameObject.Find("Vasija(Clone)"));
            }

            if (tiempoAnimacion < 0 && tomabarro)
            {
                MoverMouse.movimiento   = true;
                MoverMouse.cambioCamara = false;
                if (actualizar && General.paso_mision == 6 && General.misionActual[0] == "1")
                {
                    Misiones mision = Camera.main.gameObject.GetComponent <Misiones>();
                    mision.procesoMision1(General.paso_mision);
                    actualizar = false;
                }
            }
            tomabarro = false;
        }

        if (cargarMaleta)
        {
            Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
            maleta.agregarTextura(contenidobarro);
            cargarMaleta = false;
        }
    }
Beispiel #6
0
    public void OnTriggerEnter(Collider colision)
    {
        if (colision.tag == "Player")
        {
            player         = colision.gameObject;
            playerAnimator = colision.gameObject.GetComponent <Animator>();
            playerAnimator.SetBool("recojer", true);
            tiempo           = 10;
            tiempoAnimacion  = recojer.length;
            instanciarVasija = true;
            Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
            maleta.agregarTextura(contenidobarro);

            tomabarro               = true;
            MoverMouse.movimiento   = false;
            MoverMouse.cambioCamara = true;
            actualizar              = true;
        }
    }
Beispiel #7
0
    public void OnTriggerEnter(Collider colision)
    {
        if (colision.gameObject.name == Network.player.ipAddress)
        {
            actualizar = true;

            playerAnimator = colision.gameObject.GetComponent <Animator>();
            playerAnimator.SetBool("recojer", true);

            Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
            maleta.agregarTextura(madera);

            MoverMouse.movimiento   = false;
            MoverMouse.cambioCamara = true;

            tomaMadera      = true;
            tiempoAnimacion = recojerAnimacion.length;
            Destroy(gameObject, 5);
            tiempo = 5;
        }
    }
Beispiel #8
0
    // Update is called once per frame
    void Update()
    {
        if (instanciar)
        {
            chiaInstanciar();
            if (General.timepo <= 0)
            {
                General.timepo     = 15;
                General.timepoChia = 16;
            }
        }
        if (General.timepo > 0)
        {
            if (terminoMision)
            {
                completarMision();
            }
            else
            {
                switch (General.misionActual[0])
                {
                case "1":
                    Mision1();
                    break;

                case "2":
                    Mision2();
                    break;
                }
            }
        }

        if (General.misionActual[0] == "2" && Network.peerType != NetworkPeerType.Disconnected && General.timepo <= 0)
        {
            if (GameObject.Find("chozas") && !GameObject.Find("Chia(clone)"))
            {
                Maleta.vaciar         = true;
                MoverMouse.movimiento = false;
                Application.LoadLevelAdditive("level2");
                Destroy(GameObject.Find("Escenario"));
                Destroy(GameObject.Find("fogata"));
                Destroy(GameObject.Find("micos"));
                Destroy(GameObject.Find("chozas"));
                if (GameObject.Find("Pieza de oro(Clone)"))
                {
                    Destroy(GameObject.Find("Pieza de oro(Clone)"));
                }

                Camera.main.transform.parent = GameObject.Find("PlayerJuego").transform;
                Vector3 posicion = GameObject.Find("PlayerJuego").transform.position;
                Network.Destroy(GameObject.Find(Network.player.ipAddress));
                GameObject g = new GameObject();
                switch (General.idPersonaje)
                {
                case 1:
                    g = (GameObject)Network.Instantiate(pj12, posicion, transform.rotation, 0);
                    break;

                case 2:
                    g = (GameObject)Network.Instantiate(pj22, posicion, transform.rotation, 0);
                    break;

                case 3:
                    g = (GameObject)Network.Instantiate(pj32, posicion, transform.rotation, 0);
                    break;
                }

                g.transform.localScale = new Vector3(2, 2, 2);
                g.AddComponent <BoxCollider>();
                g.GetComponent <BoxCollider> ().size = new Vector3(0.1f, 0.1f, 0.1f);
                g.name = Network.player.ipAddress;
                Misiones.cambio_mapa = true;
            }
        }

        if (cambio_mapa && GameObject.Find("PlayerJuego2"))
        {
            GameObject.Find("PlayerJuego").transform.position = GameObject.Find("PlayerJuego2").transform.position;
            Destroy(GameObject.Find("Luz2"));
            if (General.paso_mision == 1)
            {
                GameObject.Find(Network.player.ipAddress).transform.position = GameObject.Find("PlayerJuego2").transform.position;
            }
            cambio_mapa           = false;
            MoverMouse.movimiento = true;
            Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
            maleta.agregarTextura(tributo);
        }

        if (terminoMision && General.timepo < 0)
        {
            instanciar    = true;
            terminoMision = false;
        }
    }
Beispiel #9
0
    void OnGUI()
    {
        if (iniciarConversasion && player.GetComponent <NetworkView> ().isMine)
        {
            switch (General.paso_mision)
            {
            case 5:
                if (tiempo > 16)
                {
                    mensaje = "Bienvenidos a Altagracia de Sumapaz,";

                    if (voz.clip.name != v1.name)
                    {
                        voz.clip = v1;
                        voz.Play();
                    }
                }
                else if (tiempo > 11)
                {
                    if (voz.clip.name != v2.name)
                    {
                        voz.clip = v2;
                        voz.Play();
                    }
                    mensaje = "he aquí recibo sus tributos y te entrego este permiso.";
                    if (!GameObject.Find("pieza0"))
                    {
                        GameObject pieza = (GameObject)Instantiate(premio, virrey.transform.position, transform.rotation);
                        pieza.transform.parent   = virrey.transform;
                        pieza.transform.rotation = new Quaternion();
                        pieza.transform.Rotate(0, 265, 0);
                        pieza.transform.localPosition = new Vector3(2f, 0f, 0f);
                        pieza.name = "pieza0";

                        Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
                        maleta.eliminarTextura("premio");
                    }
                    else
                    {
                        GameObject.Find("pieza0").transform.Rotate(0f, -10f * Time.deltaTime, 0f);

                        if (!GameObject.Find("permiso"))
                        {
                            GameObject permisoObj = (GameObject)Instantiate(permiso, virrey.transform.position, transform.rotation);
                            permisoObj.transform.parent   = virrey.transform;
                            permisoObj.transform.rotation = new Quaternion();
                            permisoObj.transform.Rotate(300f, 180f, 0f);
                            permisoObj.transform.localPosition = new Vector3(-2f, 0f, 0f);
                            permisoObj.name = "permiso";
                        }
                    }
                }
                else if (tiempo > 5)
                {
                    if (voz.clip.name != v3.name)
                    {
                        voz.clip = v3;
                        voz.Play();
                    }
                    mensaje = "Llevadlo a Bernardino de Albornoz que se encuentra en";
                    GameObject.Find("pieza0").transform.Translate(0.01f, 0, 0);
                    GameObject.Find("permiso").transform.Translate(-0.01f, 0, 0);
                }
                else if (tiempo > 1)
                {
                    mensaje = "Fusagasugá, y entregadlo. Él les dirá que hacer.";
                }
                break;
            }

            GUIStyle style = new GUIStyle();
            style.alignment = TextAnchor.MiddleCenter;
            style           = GUI.skin.GetStyle("Box");
            style.fontSize  = (int)(20.0f);

            GUI.Box(new Rect(Screen.width / 10, 3 * Screen.height / 4, 2 * (Screen.width / 3), Screen.height / 4), mensaje);

            style.fontSize = (int)(15.0f);
            GUI.Box(new Rect(Screen.width / 10, 3 * Screen.height / 4 - Screen.height / 24, Screen.width / 4, Screen.height / 24), "Virrey");

            if (General.paso_mision == 5 && General.misionActual [0] == "2" && tiempo < 0.5)
            {
                //General.timepo = 10;
                //Misiones mision = Camera.main.gameObject.GetComponent<Misiones> ();
                //mision.procesoMision2 (General.paso_mision);
                Destroy(GameObject.Find("pieza0"));
                Destroy(GameObject.Find("permiso"));
                Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();
                maleta.agregarTextura(premioTextura);
                iniciarConversasion = false;
                Misiones mision = Camera.main.gameObject.GetComponent <Misiones> ();
                mision.procesoMision2(General.paso_mision);
            }

            MoverMouse.movimiento = true;
        }
    }
Beispiel #10
0
    // Update is called once per frame
    void Update()
    {
        if (General.misionActual [0] == "3")
        {
            switch (General.idPersonaje)
            {
            case 1:
                General.personaje = pjR13;
                break;

            case 2:
                General.personaje = pjR23;
                break;

            case 3:
                General.personaje = pjR33;
                break;
            }
        }

        Maleta maleta = Camera.main.gameObject.GetComponent <Maleta>();

        prepararMaleta(maleta);


        if (instanciar)
        {
            if (General.timepo <= 0)
            {
                if (General.misionActual [0] == "1")
                {
                    General.timepo     = 15;
                    General.timepoChia = 15;
                }
                else if (General.misionActual [0] == "2")
                {
                    General.timepo     = 35;
                    General.timepoChia = 36;
                }
                else if (General.misionActual [0] == "3" && General.paso_mision == 1)
                {
                    General.timepo     = 22;
                    General.timepoChia = 22.5f;
                }
                else if (General.misionActual [0] == "3")
                {
                    switch (General.paso_mision)
                    {
                    case 2:
                        General.timepo     = 6;
                        General.timepoChia = 6.5f;
                        break;

                    case 3:
                        General.timepo     = 10;
                        General.timepoChia = 10.5f;
                        break;

                    case 4:
                        General.timepo     = 7;
                        General.timepoChia = 7.5f;
                        break;

                    case 5:
                        General.timepo     = 7;
                        General.timepoChia = 7.5f;
                        break;

                    case 6:
                        General.timepo     = 10;
                        General.timepoChia = 10.5f;
                        break;

                    case 7:
                        General.timepo     = 6;
                        General.timepoChia = 6.5f;
                        break;

                    case 8:
                        General.timepo     = 10;
                        General.timepoChia = 10.5f;
                        break;

                    case 9:
                        General.timepo     = 7;
                        General.timepoChia = 7.5f;
                        break;

                    case 10:
                        General.timepo     = 7;
                        General.timepoChia = 7.5f;
                        break;

                    case 11:
                        General.timepo     = 6;
                        General.timepoChia = 6.5f;
                        break;

                    default:
                        General.timepo     = 15;
                        General.timepoChia = 15.5f;
                        break;
                    }
                    General.timepo     = 15;
                    General.timepoChia = 15.5f;
                }
                else
                {
                    General.timepo     = 15;
                    General.timepoChia = 16;
                }
            }
            if (General.misionActual [0] == "2" && General.paso_mision == 0)
            {
                General.timepo     = 1f;
                General.timepoChia = 1.5f;
            }

            chiaInstanciar();
        }
        if (General.timepo > 0)
        {
            if (terminoMision)
            {
                switch (General.misionActual[0])
                {
                case "2":
                    completarMision();
                    break;

                case "3":
                    completarMision2();
                    break;

                case "4":
                    completarMision3();
                    break;
                }
            }
            else
            {
                switch (General.misionActual [0])
                {
                case "1":
                    Mision1();
                    break;

                case "2":
                    Mision2();
                    break;

                case "3":
                    Mision3();
                    break;
                }
            }
        }

        if (General.misionActual [0] == "2" && Network.peerType != NetworkPeerType.Disconnected && General.timepo <= 0)
        {
            if (GameObject.Find("chozas") && !GameObject.Find("Chia(clone)"))
            {
                Maleta.vaciar = true;

                MoverMouse.movimiento = false;
                SceneManager.LoadScene("level2");
                if (GameObject.Find("Pieza de oro(Clone)"))
                {
                    Destroy(GameObject.Find("Pieza de oro(Clone)"));
                }

                Camera.main.transform.parent = GameObject.Find("IniciarVariables").transform;

                if (General.misionActual [0] == "2")
                {
                    switch (General.idPersonaje)
                    {
                    case 1:
                        General.personaje = pjR12;
                        break;

                    case 2:
                        General.personaje = pjR22;
                        break;

                    case 3:
                        General.personaje = pjR32;
                        break;
                    }
                }

                Network.Destroy(GameObject.Find(Network.player.ipAddress));
                GameObject g = (GameObject)Network.Instantiate(General.personaje, new Vector3(General.posicionIncial.x, General.posicionIncial.y + 10f, General.posicionIncial.z), new Quaternion(), 1);
                g.transform.localScale = new Vector3(2, 2, 2);
                g.AddComponent <BoxCollider> ();
                g.GetComponent <BoxCollider> ().size = new Vector3(0.1f, 0.1f, 0.1f);

                g.name = Network.player.ipAddress;

                MoverMouse.movimiento = true;
                Misiones.cambio_mapa  = true;
            }
        }

        if (General.misionActual [0] == "3" && Network.peerType != NetworkPeerType.Disconnected && General.timepo <= 0)
        {
            if ((GameObject.Find("casas") || GameObject.Find("chozas")) && !GameObject.Find("Chia(clone)"))
            {
                Maleta.vaciar = true;

                MoverMouse.movimiento = false;
                Destroy(GameObject.Find("camara"));
                SceneManager.LoadScene("level3");

                Camera.main.transform.parent = GameObject.Find("IniciarVariables").transform;
                Misiones.cambio_mapa         = true;

                Network.Destroy(GameObject.Find(Network.player.ipAddress));
                GameObject g = (GameObject)Network.Instantiate(General.personaje, new Vector3(General.posicionIncial.x, General.posicionIncial.y + 10f, General.posicionIncial.z), new Quaternion(), 1);
                g.transform.localScale = new Vector3(1, 1, 1);
                g.AddComponent <BoxCollider> ();
                g.GetComponent <BoxCollider> ().size = new Vector3(0.1f, 0.1f, 0.1f);

                g.name = Network.player.ipAddress;
            }
            if (GameObject.Find("Luz_tormenta"))
            {
                luzrayos = GameObject.Find("Luz_tormenta");
                luzrayos.SetActive(false);
            }
            MoverMouse.movimiento = true;
        }

        if (General.misionActual [0] == "4" && Network.peerType != NetworkPeerType.Disconnected && General.timepo <= 0)
        {
            Debug.Log("Subiendo de level");
            if (GameObject.Find("Casa1"))
            {
                MoverMouse.movimiento = false;
                Destroy(GameObject.Find("camara"));
                SceneManager.LoadScene("fin");

                Camera.main.transform.parent = GameObject.Find("PlayerJuego").transform;
                GameObject.Find(Network.player.ipAddress).transform.localScale = new Vector3(1f, 1f, 1f);
                Misiones.cambio_mapa = true;
            }
        }

        if (cambio_mapa && GameObject.Find("PlayerJuego2"))
        {
            GameObject.Find("PlayerJuego2").name = "PlayerJuego";
            GameObject.Find("Luz").GetComponent <Light>().intensity = 1.5f;
            if (General.paso_mision == 1 || General.paso_mision == 0)
            {
                GameObject.Find(Network.player.ipAddress).transform.position = GameObject.Find("PlayerJuego").transform.position;
            }

            MoverMouse.movimiento = true;

            if (General.misionActual [0] == "2" && General.paso_mision > 6)
            {
                maleta.agregarTextura(tributo);
            }
            cambio_mapa = false;
        }

        if (luzrayos == null)
        {
            luzrayos = GameObject.Find("Luz_tormenta");
            if (GameObject.Find("Luz_tormenta"))
            {
                luzrayos.SetActive(false);
            }
        }

        if (luz == null)
        {
            luz = GameObject.Find("Luz");
        }

        if (terminoMision && General.timepo < 0)
        {
            Camera.main.transform.parent = GameObject.Find("IniciarVariables").transform;
            instanciar    = true;
            terminoMision = false;
            Conexion conexion = Camera.main.gameObject.GetComponent <Conexion>();
            conexion.reiniciar = true;

            luzrayos.SetActive(false);
        }

        if (General.misionActual[0] == "2" && General.paso_mision == 7 && !GameObject.Find("Rain(Clone)") && SceneManager.GetActiveScene().name == "level2")
        {
            GameObject lluvia = (GameObject)Instantiate(rain, transform.position, transform.rotation);
            lluvia.transform.parent = transform;
            RenderSettings.skybox   = tormenta;
            GameObject.Find("Luz").SetActive(false);
            luzrayos.SetActive(true);
        }

        if (GameObject.Find(Network.player.ipAddress))
        {
            if (GameObject.Find(Network.player.ipAddress).GetComponent <NetworkView> ().isMine)
            {
                PuntosClave();
            }
        }
    }