コード例 #1
0
ファイル: Menu.cs プロジェクト: FcoReyesV/VideojuegoADOO
 public void RegresarMenu()
 {
     IniciarJ.SetActive(true);
     Instrucciones.SetActive(true);
     TextoInstruc.SetActive(false);
     Regresar.SetActive(false);
     Imagen1.SetActive(false);
     Imagen2.SetActive(false);
     PelotaImg.SetActive(false);
 }
コード例 #2
0
        void ReleaseDesignerOutlets()
        {
            if (Imagen1 != null)
            {
                Imagen1.Dispose();
                Imagen1 = null;
            }

            if (Imagen2 != null)
            {
                Imagen2.Dispose();
                Imagen2 = null;
            }

            if (SliderImagen != null)
            {
                SliderImagen.Dispose();
                SliderImagen = null;
            }

            if (lblNumero != null)
            {
                lblNumero.Dispose();
                lblNumero = null;
            }

            if (txtNumero != null)
            {
                txtNumero.Dispose();
                txtNumero = null;
            }

            if (Incrementador != null)
            {
                Incrementador.Dispose();
                Incrementador = null;
            }
        }
コード例 #3
0
        void ReleaseDesignerOutlets()
        {
            if (Imagen != null)
            {
                Imagen.Dispose();
                Imagen = null;
            }

            if (Imagen2 != null)
            {
                Imagen2.Dispose();
                Imagen2 = null;
            }

            if (Mapa != null)
            {
                Mapa.Dispose();
                Mapa = null;
            }

            if (Progreso != null)
            {
                Progreso.Dispose();
                Progreso = null;
            }

            if (Texto != null)
            {
                Texto.Dispose();
                Texto = null;
            }

            if (VisorWeb != null)
            {
                VisorWeb.Dispose();
                VisorWeb = null;
            }
        }
コード例 #4
0
    public void PosAleatoria(int tipo)
    {
        //el valor de la variable debe ser acorde al numero de respuestas en la pregunta
        int maxvalues = 0;

        //if para identificar a que pregunta entrará
        if (tipo == 1)
        {
            print("Entro a Q1");
            Imagen1 = GameObject.FindGameObjectWithTag("objRespuesta1");
            Imagen2 = GameObject.FindGameObjectWithTag("objRespuesta2");
            Imagen3 = GameObject.FindGameObjectWithTag("objRespuesta3");
            Imagen4 = GameObject.FindGameObjectWithTag("objRespuesta4");

            transform1 = Imagen1.GetComponent <Transform>();
            transform2 = Imagen2.GetComponent <Transform>();
            transform3 = Imagen3.GetComponent <Transform>();
            transform4 = Imagen4.GetComponent <Transform>();

            temp1 = transform1.position;
            temp2 = transform2.position;
            temp3 = transform3.position;
            temp4 = transform4.position;

            rotation1 = transform1.rotation.eulerAngles;
            rotation2 = transform2.rotation.eulerAngles;
            rotation3 = transform3.rotation.eulerAngles;
            rotation4 = transform4.rotation.eulerAngles;
            maxvalues = 5;
        }

        if (tipo == 2)
        {
            print("Entro a Q3");
            Imagen1 = GameObject.FindGameObjectWithTag("Q3.1");
            Imagen2 = GameObject.FindGameObjectWithTag("Q3.2");
            Imagen3 = GameObject.FindGameObjectWithTag("Q3.3");
            Imagen4 = GameObject.FindGameObjectWithTag("Q3.4");

            transform1 = Imagen1.GetComponent <Transform>();
            transform2 = Imagen2.GetComponent <Transform>();
            transform3 = Imagen3.GetComponent <Transform>();
            transform4 = Imagen4.GetComponent <Transform>();

            temp1 = transform1.position;
            temp2 = transform2.position;
            temp3 = transform3.position;
            temp4 = transform4.position;

            rotation1 = transform1.rotation.eulerAngles;
            rotation2 = transform2.rotation.eulerAngles;
            rotation3 = transform3.rotation.eulerAngles;
            rotation4 = transform4.rotation.eulerAngles;
            maxvalues = 5;
        }

        if (tipo == 3)
        {
            print("Entro a multi");
            Imagen1 = GameObject.FindGameObjectWithTag("MultiR1");
            Imagen2 = GameObject.FindGameObjectWithTag("MultiR2");
            Imagen3 = GameObject.FindGameObjectWithTag("MultiR3");
            Imagen4 = GameObject.FindGameObjectWithTag("MultiR4");
            Imagen5 = GameObject.FindGameObjectWithTag("MultiR5");

            transform1 = Imagen1.GetComponent <Transform>();
            transform2 = Imagen2.GetComponent <Transform>();
            transform3 = Imagen3.GetComponent <Transform>();
            transform4 = Imagen4.GetComponent <Transform>();
            transform5 = Imagen5.GetComponent <Transform>();

            temp1 = transform1.position;
            temp2 = transform2.position;
            temp3 = transform3.position;
            temp4 = transform4.position;
            temp5 = transform5.position;

            rotation1 = transform1.rotation.eulerAngles;
            rotation2 = transform2.rotation.eulerAngles;
            rotation3 = transform3.rotation.eulerAngles;
            rotation4 = transform4.rotation.eulerAngles;
            rotation5 = transform5.rotation.eulerAngles;
            maxvalues = 6;
        }

        if (tipo == 4)
        {
            print("Entro a par");
            Imagen1 = GameObject.FindGameObjectWithTag("Par1.1");
            Imagen2 = GameObject.FindGameObjectWithTag("Par1.2");
            Imagen3 = GameObject.FindGameObjectWithTag("Par2.1");
            Imagen4 = GameObject.FindGameObjectWithTag("Par2.2");
            Imagen5 = GameObject.FindGameObjectWithTag("Par3.1");
            Imagen6 = GameObject.FindGameObjectWithTag("Par3.2");

            transform1 = Imagen1.GetComponent <Transform>();
            transform2 = Imagen2.GetComponent <Transform>();
            transform3 = Imagen3.GetComponent <Transform>();
            transform4 = Imagen4.GetComponent <Transform>();
            transform5 = Imagen5.GetComponent <Transform>();
            transform6 = Imagen6.GetComponent <Transform>();

            temp1 = transform1.position;
            temp2 = transform2.position;
            temp3 = transform3.position;
            temp4 = transform4.position;
            temp5 = transform5.position;
            temp6 = transform6.position;

            rotation1 = transform1.rotation.eulerAngles;
            rotation2 = transform2.rotation.eulerAngles;
            rotation3 = transform3.rotation.eulerAngles;
            rotation4 = transform4.rotation.eulerAngles;
            rotation5 = transform5.rotation.eulerAngles;
            rotation6 = transform6.rotation.eulerAngles;
            maxvalues = 7;
        }

        //Generar en orden aleatoria los numeros de 1 al 5
        int             i       = 1;
        HashSet <Int32> numeros = new HashSet <Int32>();

        System.Random ran = new System.Random();

        while (numeros.Count < maxvalues)
        {
            numeros.Add(ran.Next(maxvalues));
        }

        foreach (int n in numeros)
        {
            if (n != 0)
            {
                num = n;
                if (i == 1)
                {
                    asignarPos(transform1);
                    i++;
                }
                else if (i == 2)
                {
                    asignarPos(transform2);
                    i++;
                }
                else if (i == 3)
                {
                    asignarPos(transform3);
                    i++;
                }
                else if (i == 4)
                {
                    asignarPos(transform4);
                    i++;
                }
                else if (i == 5)
                {
                    asignarPos(transform5);
                    i++;
                }
                else if (i == 6)
                {
                    asignarPos(transform6);
                    i++;
                }
            }
        }
    }