Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        //instancio la clase de metodos sobre la base de datos
        GameObject go = new GameObject();

        go.AddComponent <QryElementos>();
        qryElement = go.GetComponent <QryElementos>();

        //busca en este caso en el panel "this" que es el llamador un componente especifico, esto reemplaza enviar el gameobject por interface
        glg = this.GetComponent <GridLayoutGroup>();

        popup = FindObjectOfType <UIPopup>();

        //Recorro todas las celdas que tienen un game object
        for (int i = 0; i < glg.transform.childCount; i++)
        {
            button = glg.transform.GetChild(i).GetComponent <Button>();

            //si no es NULL quiere decir que MAPEO un boton ahi tengo que ir a la base de datos
            if (button != null)
            {
                LoadData(button);
            }
        }
    }
Пример #2
0
    private void Awake()
    {
        //se instancia las clases para querys
        GameObject go = new GameObject();

        go.AddComponent <QryElementos>();
        go.AddComponent <QryMoleculas>();
        go.AddComponent <QryMaterials>();
        qryElement  = go.GetComponent <QryElementos>();
        qryMolecule = go.GetComponent <QryMoleculas>();
        qryMaterial = go.GetComponent <QryMaterials>();

        InitializeCategoryDictionary();
        PanelInfoLoader = FindObjectOfType <PanelInfoLoader>();

        nameLblMolecule = infoContainerMolecule.GetComponentInChildren <TextMeshProUGUI>();
        nameLbl         = infoContainer.GetComponentInChildren <TextMeshProUGUI>(); //aunque hay 2 lbl el 1ro es el name
        nameLblMaterial = infoContainerMaterial.GetComponentInChildren <TextMeshProUGUI>();
        nameLblIsotopos = infoContainerIsotopos.GetComponentInChildren <TextMeshProUGUI>();
    }