Problema al crear objeto por segunda vez. Problem to instantatiate a object for second try.

Disculpen, tengo un problema con mi codigo que tengo que presentar para mi tesis por motivos estudiantiles (siendo redundante) y no he logrado resolverlo que ademas de no entender porque sucede.

La idea de mi programa es hacer un juego estilo trivia, en la cual, de una cierta pregunta se te dan 4 respuestas que solo 1 de ellas es la correcta. Las Preguntas y Respuestas estan en una base de datos por MySQL.

El Problema radica es cuando yo inicio el juego, sale la primera pregunta en texto y las 4 respuestas en botones sin ningun problema, pero cuando respondo y sale la segunda pregunta solo aparece el texto de la pregunta y los botones de las respuestas no se crean. He revisado todo y he colocado un Debug.Log donde se crean los objetos y si realiza la funcion pero no me crea el objeto.

Les paso el codigo espero puedan ayudarme.

I apologize , I have a problem with my code that I have to submit my thesis and have failed to resolve , that in addition to not understand why it happens.

The idea of my program is to make a style trivia game, in which, in a certain question you get 4 answers that only one of them is correct. The questions and answers are in a MySQL database .

The problem is when I start the game , comes the first question in text and 4 responses buttons without any problem, but when I answer , comes the second question, and only the text of the question is appears and the buttons not. I’ve checked everything and I have placed a debug.log where objects are created and yes , do the work but did not create the object .

I pass the code I hope you can help me

using System;
using UnityEngine.UI;
using MySql.Data.MySqlClient;
using System.Collections;
using UnityEngine.EventSystems;

public class PreguntasYRespuestas : MonoBehaviour {

public Transform Padre;
public Button boton;
public bool Inicio;
public Animator anim;
public GameObject Paneles;
public GameObject Empe;
//EstadoLogin estadologin;

private Button botpan;
private string source;
private MySqlConnection Conex;
private MySqlCommand Comando;
private MySqlDataReader LeerBD;
private bool Error;
private string TextoError;
private int NumPregunta;
private string Examen;
private bool Respondio;
private int Puntuacion;

// Use this for initialization
void Start () {
	Inicio = false;
	Respondio = false;
	NumPregunta = 0;
	Puntuacion = 0;
	source = "Server=localhost;" +
		"Database =tesistest;" +
			"User ID = root;" +
			"Pooling=false;" +
			"Passwaord=";
	
	
}

void Update(){

	if (Inicio == true) {

		if(Respondio == true){

			Respondio = false;

		}		
	}

}

public void Empezar(){
	Inicio = true;
	NumPregunta = EstadoLogin.estadologin.NumeroPregunta;
	Examen = EstadoLogin.estadologin.ExamRealizar;
	Destroy (Empe);
	Conex = new MySqlConnection (source);
	Buscar ();
}

public void Buscar (){
	try{
		Conex.Open();
		Comando = Conex.CreateCommand ();
		Comando.CommandText = "SELECT * FROM `examenes` WHERE `Examenes` like '"+Examen+"' AND `Numero de pregunta` = "+NumPregunta+"";
		LeerBD = Comando.ExecuteReader ();
		//Vector3 Spawnpos = new Vector3(-0.1f,3.5f,0);
		while (LeerBD.Read()) {
			string Pregunta = (string)LeerBD["Pregunta"];
			string Respuesta1 = (string)LeerBD["Resp"];
			string Respuesta2 = (string)LeerBD["Resp 2"];
			string Respuesta3 = (string)LeerBD["Resp 3"];
			string RespuestaCorrecta = (string)LeerBD["RespCorrect"];
			Button BotonResp;

			GameObject PanelDePreguntas = (GameObject)Instantiate (Paneles,Padre.position,Quaternion.identity);
			anim = PanelDePreguntas.GetComponent<Animator>();
			PanelDePreguntas.transform.SetParent (Padre);
			PanelDePreguntas.GetComponent<RectTransform>().sizeDelta = new Vector2(238.51f,190.52f);
			//PanelDePreguntas.transform.localPosition = new Vector3(75.75002f,57.25f,0f);
			PanelDePreguntas.transform.localScale = new Vector3 (1f, 1f, 1f);
			PanelDePreguntas.GetComponentInChildren <Text>().text = Pregunta;
			Transform PanelRespuestas = GameObject.Find("Panel de respuestas").GetComponentInChildren<Text>().transform;

			// las posiciones son : 1)71.95f 2) 26.95 3) -16.5 4) -61.5
			int[] posicion = new int[5];
			posicion[0] = 0;
			posicion[1] = 0;
			posicion[2] = 0;
			posicion[3] = 0;
			posicion[4] = UnityEngine.Random.Range(1,5);
				if(Respuesta1 != ""){
				Debug.Log("alo");
					BotonResp= (Button)Instantiate(boton,PanelRespuestas.transform.position,Quaternion.identity);
					BotonResp.transform.SetParent(PanelRespuestas);
					BotonResp.GetComponent<RectTransform>().sizeDelta = new Vector2(182.1f,45f);
					posicion[0] = posicion[4];
					Posicionar(BotonResp,posicion[0]);
					BotonResp.transform.localScale = new Vector3(1f,1f,1f);
					BotonResp.GetComponentInChildren<Text>().text = Respuesta1;
					BotonResp.onClick.AddListener(()=>Fallar(anim,PanelDePreguntas));
					posicion[4] = UnityEngine.Random.Range(1,5);
				Debug.Log("Objeto creado "+NumPregunta);
				}
				
				if(Respuesta2 != ""){
					BotonResp = (Button)Instantiate(boton,PanelRespuestas.transform.position,Quaternion.identity);
					BotonResp.transform.SetParent(PanelRespuestas);
					BotonResp.GetComponent<RectTransform>().sizeDelta = new Vector2(182.1f,45f);
					posicion[1] = posicion[4];
					while(posicion[1] == posicion[0]) posicion[1] = UnityEngine.Random.Range(1,5);
					Posicionar(BotonResp,posicion[1]);
					BotonResp.transform.localScale = new Vector3(1f,1f,1f);
					BotonResp.GetComponentInChildren<Text>().text = Respuesta2;
					BotonResp.onClick.AddListener(()=>Fallar(anim,PanelDePreguntas));
					posicion[4] = UnityEngine.Random.Range(1,5);
				Debug.Log("1 Objeto creado "+NumPregunta);
				}
				if(Respuesta3 != ""){
					BotonResp= (Button)Instantiate(boton,PanelRespuestas.transform.position,Quaternion.identity);
					BotonResp.transform.SetParent(PanelRespuestas);
					BotonResp.GetComponent<RectTransform>().sizeDelta = new Vector2(182.1f,45f);
					posicion[2] = posicion[4];
					while(posicion[2] == posicion[0] || posicion[2] == posicion[1]) 
					posicion[2] = UnityEngine.Random.Range(1,5);
					Posicionar(BotonResp,posicion[2]);
					BotonResp.transform.localScale = new Vector3(1f,1f,1f);
					BotonResp.GetComponentInChildren<Text>().text = Respuesta3;
					BotonResp.onClick.AddListener(()=>Fallar(anim,PanelDePreguntas));
					posicion[4] = UnityEngine.Random.Range(1,5);
				Debug.Log("2 Objeto creado "+NumPregunta);
				}
				if(RespuestaCorrecta != ""){
					BotonResp= (Button)Instantiate(boton,PanelRespuestas.transform.position,Quaternion.identity);
					BotonResp.transform.SetParent(PanelRespuestas);
					BotonResp.GetComponent<RectTransform>().sizeDelta = new Vector2(182.1f,45f);
					posicion[3] = posicion[4];
					while(posicion[3] == posicion[0] || posicion[3] == posicion[1] || posicion[3] == posicion[2]) 
					posicion[3] = UnityEngine.Random.Range(1,5);
					Posicionar(BotonResp,posicion[3]);
					BotonResp.transform.localScale = new Vector3(1f,1f,1f);
					BotonResp.GetComponentInChildren<Text>().text = RespuestaCorrecta;
					BotonResp.onClick.AddListener(()=>Acertar(anim,PanelDePreguntas));
				Debug.Log("3 Objeto creado "+NumPregunta);
				}
			
			Debug.Log(Pregunta);
			Debug.Log(Respuesta1);
			Debug.Log(Respuesta2);
			Debug.Log(Respuesta3);
			Debug.Log(RespuestaCorrecta);

		}

	}
	catch(Exception ex){
		Error = true;
		TextoError = ex.ToString();	
	}
	
	Conex.Close ();
	Debug.Log("cerrado");

}

void Posicionar(Button boton, int Posi){
	
		if (Posi == 1)
			boton.transform.localPosition = new Vector3 (-11.05f, 71.95f, 0);
		if (Posi == 2)
			boton.transform.localPosition = new Vector3 (-11.05f, 26.95f, 0);
		if (Posi == 3)
			boton.transform.localPosition = new Vector3 (-11.05f, -16.5f, 0);
		if (Posi == 4)
			boton.transform.localPosition = new Vector3 (-11.05f, -61.5f, 0);

} 

public void Fallar(Animator fallo, GameObject Eliminar){
	fallo.SetBool ("Cerrar",true);

	Destroy (Eliminar);
	Respondio = true;
	NumPregunta += 1;
	EstadoLogin.estadologin.NumeroPregunta = NumPregunta;

	Buscar();
}

public void Acertar(Animator acierto, GameObject Eliminar){
	acierto.SetBool ("Cerrar",true);
	;
	Destroy (Eliminar);
	Respondio = true;
	NumPregunta += 1;
	EstadoLogin.estadologin.NumeroPregunta = NumPregunta;
	Puntuacion += 1;

	Buscar();
}

}

using System;
using UnityEngine.UI;
using MySql.Data.MySqlClient;
using System.Collections;
using UnityEngine.EventSystems;

public class PreguntasYRespuestas : MonoBehaviour {

	public Transform Padre;
	public Button boton;
	public bool Inicio;
	public Animator anim;
	public GameObject Paneles;
	public GameObject Empe;
	//EstadoLogin estadologin;
	
	private Button botpan;
	private string source;
	private MySqlConnection Conex;
	private MySqlCommand Comando;
	private MySqlDataReader LeerBD;
	private bool Error;
	private string TextoError;
	private int NumPregunta;
	private string Examen;
	private bool Respondio;
	private int Puntuacion;
	
	// Use this for initialization
	void Start () {
		Inicio = false;
		Respondio = false;
		NumPregunta = 0;
		Puntuacion = 0;
		source = "Server=localhost;" +
			"Database =tesistest;" +
				"User ID = root;" +
				"Pooling=false;" +
				"Passwaord=";
		
		
	}

	void Update(){

		if (Inicio == true) {

			if(Respondio == true){

				Respondio = false;

			}		
		}

	}



	public void Empezar(){
		Inicio = true;
		NumPregunta = EstadoLogin.estadologin.NumeroPregunta;
		Examen = EstadoLogin.estadologin.ExamRealizar;
		Destroy (Empe);
		Conex = new MySqlConnection (source);
		Buscar ();
	}

	public void Buscar (){
		try{
			Conex.Open();
			Comando = Conex.CreateCommand ();
			Comando.CommandText = "SELECT * FROM `examenes` WHERE `Examenes` like '"+Examen+"' AND `Numero de pregunta` = "+NumPregunta+"";
			LeerBD = Comando.ExecuteReader ();
			//Vector3 Spawnpos = new Vector3(-0.1f,3.5f,0);
			while (LeerBD.Read()) {
				string Pregunta = (string)LeerBD["Pregunta"];
				string Respuesta1 = (string)LeerBD["Resp"];
				string Respuesta2 = (string)LeerBD["Resp 2"];
				string Respuesta3 = (string)LeerBD["Resp 3"];
				string RespuestaCorrecta = (string)LeerBD["RespCorrect"];
				Button BotonResp;

				GameObject PanelDePreguntas = (GameObject)Instantiate (Paneles,Padre.position,Quaternion.identity);
				anim = PanelDePreguntas.GetComponent<Animator>();
				PanelDePreguntas.transform.SetParent (Padre);
				PanelDePreguntas.GetComponent<RectTransform>().sizeDelta = new Vector2(238.51f,190.52f);
				//PanelDePreguntas.transform.localPosition = new Vector3(75.75002f,57.25f,0f);
				PanelDePreguntas.transform.localScale = new Vector3 (1f, 1f, 1f);
				PanelDePreguntas.GetComponentInChildren <Text>().text = Pregunta;
				Transform PanelRespuestas = GameObject.Find("Panel de respuestas").GetComponentInChildren<Text>().transform;

				// las posiciones son : 1)71.95f 2) 26.95 3) -16.5 4) -61.5
				int[] posicion = new int[5];
				posicion[0] = 0;
				posicion[1] = 0;
				posicion[2] = 0;
				posicion[3] = 0;
				posicion[4] = UnityEngine.Random.Range(1,5);
					if(Respuesta1 != ""){
					Debug.Log("alo");
						BotonResp= (Button)Instantiate(boton,PanelRespuestas.transform.position,Quaternion.identity);
						BotonResp.transform.SetParent(PanelRespuestas);
						BotonResp.GetComponent<RectTransform>().sizeDelta = new Vector2(182.1f,45f);
						posicion[0] = posicion[4];
						Posicionar(BotonResp,posicion[0]);
						BotonResp.transform.localScale = new Vector3(1f,1f,1f);
						BotonResp.GetComponentInChildren<Text>().text = Respuesta1;
						BotonResp.onClick.AddListener(()=>Fallar(anim,PanelDePreguntas));
						posicion[4] = UnityEngine.Random.Range(1,5);
					Debug.Log("Objeto creado "+NumPregunta);
					}
					
					if(Respuesta2 != ""){
						BotonResp = (Button)Instantiate(boton,PanelRespuestas.transform.position,Quaternion.identity);
						BotonResp.transform.SetParent(PanelRespuestas);
						BotonResp.GetComponent<RectTransform>().sizeDelta = new Vector2(182.1f,45f);
						posicion[1] = posicion[4];
						while(posicion[1] == posicion[0]) posicion[1] = UnityEngine.Random.Range(1,5);
						Posicionar(BotonResp,posicion[1]);
						BotonResp.transform.localScale = new Vector3(1f,1f,1f);
						BotonResp.GetComponentInChildren<Text>().text = Respuesta2;
						BotonResp.onClick.AddListener(()=>Fallar(anim,PanelDePreguntas));
						posicion[4] = UnityEngine.Random.Range(1,5);
					Debug.Log("1 Objeto creado "+NumPregunta);
					}
					if(Respuesta3 != ""){
						BotonResp= (Button)Instantiate(boton,PanelRespuestas.transform.position,Quaternion.identity);
						BotonResp.transform.SetParent(PanelRespuestas);
						BotonResp.GetComponent<RectTransform>().sizeDelta = new Vector2(182.1f,45f);
						posicion[2] = posicion[4];
						while(posicion[2] == posicion[0] || posicion[2] == posicion[1]) 
						posicion[2] = UnityEngine.Random.Range(1,5);
						Posicionar(BotonResp,posicion[2]);
						BotonResp.transform.localScale = new Vector3(1f,1f,1f);
						BotonResp.GetComponentInChildren<Text>().text = Respuesta3;
						BotonResp.onClick.AddListener(()=>Fallar(anim,PanelDePreguntas));
						posicion[4] = UnityEngine.Random.Range(1,5);
					Debug.Log("2 Objeto creado "+NumPregunta);
					}
					if(RespuestaCorrecta != ""){
						BotonResp= (Button)Instantiate(boton,PanelRespuestas.transform.position,Quaternion.identity);
						BotonResp.transform.SetParent(PanelRespuestas);
						BotonResp.GetComponent<RectTransform>().sizeDelta = new Vector2(182.1f,45f);
						posicion[3] = posicion[4];
						while(posicion[3] == posicion[0] || posicion[3] == posicion[1] || posicion[3] == posicion[2]) 
						posicion[3] = UnityEngine.Random.Range(1,5);
						Posicionar(BotonResp,posicion[3]);
						BotonResp.transform.localScale = new Vector3(1f,1f,1f);
						BotonResp.GetComponentInChildren<Text>().text = RespuestaCorrecta;
						BotonResp.onClick.AddListener(()=>Acertar(anim,PanelDePreguntas));
					Debug.Log("3 Objeto creado "+NumPregunta);
					}
				
				Debug.Log(Pregunta);
				Debug.Log(Respuesta1);
				Debug.Log(Respuesta2);
				Debug.Log(Respuesta3);
				Debug.Log(RespuestaCorrecta);

			}

		}
		catch(Exception ex){
			Error = true;
			TextoError = ex.ToString();	
		}
		
		Conex.Close ();
		Debug.Log("cerrado");

	}

	void Posicionar(Button boton, int Posi){
		
			if (Posi == 1)
				boton.transform.localPosition = new Vector3 (-11.05f, 71.95f, 0);
			if (Posi == 2)
				boton.transform.localPosition = new Vector3 (-11.05f, 26.95f, 0);
			if (Posi == 3)
				boton.transform.localPosition = new Vector3 (-11.05f, -16.5f, 0);
			if (Posi == 4)
				boton.transform.localPosition = new Vector3 (-11.05f, -61.5f, 0);

	} 

	public void Fallar(Animator fallo, GameObject Eliminar){
		fallo.SetBool ("Cerrar",true);

		Destroy (Eliminar);
		Respondio = true;
		NumPregunta += 1;
		EstadoLogin.estadologin.NumeroPregunta = NumPregunta;

		Buscar();
	}



	public void Acertar(Animator acierto, GameObject Eliminar){
		acierto.SetBool ("Cerrar",true);
		;
		Destroy (Eliminar);
		Respondio = true;
		NumPregunta += 1;
		EstadoLogin.estadologin.NumeroPregunta = NumPregunta;
		Puntuacion += 1;

		Buscar();
	}


}