Question by 
               contatogcriation · Mar 15, 2019 at 04:23 PM · 
                c#2d  
              
 
              Randomize questions in a quiz game 2D
How to randomize my questions? My code is:
 using UnityEngine;
 using UnityEngine.UI;
 using System.Collections;
 
 public class responder : MonoBehaviour {
 
 
 
     private int idTema;
 
     public Text pergunta;
     public Text respostaA;
     public Text respostaB;
     public Text respostaC;
     public Text respostaD;
     public Text infoRespostas;
 
     public string[] perguntas;
     public string[] alternativaA;
     public string[] alternativaB;
     public string[] alternativaC;
     public string[] alternativaD;
     public string[] corretas;
 
     private int idPergunta;
 
     private float acertos;
     private float questoes;
     private float media;
     private int notaFinal;
     private object usedValues;
 
     // Use this for initialization
     void Start() {
 
         idTema = PlayerPrefs.GetInt("idTema");
         idPergunta = 0;
         questoes = perguntas.Length;
 
         pergunta.text = perguntas[idPergunta];
         respostaA.text = alternativaA[idPergunta];
         respostaB.text = alternativaB[idPergunta];
         respostaC.text = alternativaC[idPergunta];
         respostaD.text = alternativaD[idPergunta];
 
         infoRespostas.text = "Respondendo " + (idPergunta + 1).ToString() + " de " + questoes.ToString() + " perguntas.";
    
     }
 
     public void resposta(string alternativa)
     {
 
         if (alternativa == "A")
         {
 
             if (alternativaA[idPergunta] == corretas[idPergunta])
             {
 
                 acertos += 1;
             }
 
 
         }
         else if (alternativa == "B")
         {
             if (alternativaB[idPergunta] == corretas[idPergunta])
             {
 
                 acertos += 1;
             }
 
         }
 
         else if (alternativa == "C")
         {
             if (alternativaC[idPergunta] == corretas[idPergunta])
             {
 
                 acertos += 1;
             }
 
         }
 
         else if (alternativa == "D")
         {
             if (alternativaD[idPergunta] == corretas[idPergunta])
             {
                 acertos += 1;
             }
 
         }
 
         proximaPergunta();
 
     }
 
 
 
 
   
     void proximaPergunta()
     {
         idPergunta += 1;
 
         if(idPergunta <= (questoes-1))
         {
             pergunta.text = perguntas[idPergunta];
             respostaA.text = alternativaA[idPergunta];
             respostaB.text = alternativaB[idPergunta];
             respostaC.text = alternativaC[idPergunta];
             respostaD.text = alternativaD[idPergunta];
 
             infoRespostas.text = "Respondendo " + (idPergunta + 1).ToString() + " de " + questoes.ToString() + " perguntas.";
         }
         else
         {
             media = 10 * (acertos / questoes);
             notaFinal = Mathf.RoundToInt(media);
 
             if (notaFinal > PlayerPrefs.GetInt("notaFinal"+idTema.ToString()))
             {
                 PlayerPrefs.SetInt("notaFinal"+idTema.ToString(), notaFinal);
                 PlayerPrefs.SetInt("acertos"+idTema.ToString(), (int) acertos);
             }
 
             PlayerPrefs.SetInt("notaFinalTemp" + idTema.ToString(), notaFinal);
             PlayerPrefs.SetInt("acertosTemp" + idTema.ToString(), (int)acertos);
 
 
             Application.LoadLevel("notaFinal");
         }
 
     }
 
 
 
 
 }
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
Player not moving 1 Answer
I cant get 2D collisions to work, but everything looks ok to me, any help please? 4 Answers
How to detect if ObjectA is looking at ObjectB, and vice versa? 2 Answers
Set One GameObject Inactive If Another GameObject Is Active? 1 Answer
I can't get a "victim" (can be seen as enemy) to follow the player within a certain range 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                