Exemplo n.º 1
0
    void Start()
    {
        Screen.fullScreen = false; //Necesario para que la barra de acción inferior en algunos dispositivos android no se oculte
        //Patron Singleton
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }

        instance = this;
        DontDestroyOnLoad(this.gameObject);

        itemDB = new ItemDatabase(); //Objeto que contiene las preguntas del juego

        //Si el archivo existe, lee los datos del XML. Si no existe, lee txts y crea un nuevo archivo.
        if (File.Exists(Application.persistentDataPath + "/item_data.xml"))
        {
            LoadDataFromXML();
        }
        else
        {
            ReadTxTs();
        }
    }
Exemplo n.º 2
0
 void FindObjects()      //Busqueda de objetos
 {
     statesController   = GameObject.Find("ControladorEstados").GetComponent <ControladorEstadosRelax> ();
     singletonQuestions = GameObject.Find("ObjetoSingleton").GetComponent <PreguntasSingleton>();
     singletonQuestions.setControllerGameNumber(2);
     powerupFirstChip      = GameObject.Find("PanelPrimera");
     powerupDeleteChip     = GameObject.Find("PanelEliminar");
     chipsSet              = GameObject.Find("FichasColocadas");
     chipZone              = GameObject.Find("ZonaFichas");
     initialDropZone       = GameObject.Find("DropZone");
     boardGame             = GameObject.Find("TableroJuego");
     dropHereTableroJuego  = boardGame.GetComponent <DropHere>();
     correctText           = GameObject.Find("textoAciertos").GetComponent <Text>();
     coinsText             = GameObject.Find("TextoMonedas").GetComponent <Text>();
     skipQuestionPriceText = GameObject.Find("PrecioPasarPregunta").GetComponent <Text>();
     setFirstPriceText     = GameObject.Find("PrecioPonerPrimera").GetComponent <Text>();
     deleteChipPriceText   = GameObject.Find("PrecioEliminarFicha").GetComponent <Text>();
     imageFilter           = GameObject.Find("Filtro").GetComponent <Image>();
     cleanBoardButton      = GameObject.Find("LimpiarTableroButton");
 }