Exemplo n.º 1
0
    void Start()
    {
        readObjects = GameObject.Find("CSV_objets_lecture").GetComponent <ReadObjects>();
        allObjects  = readObjects.allObjects;

        for (var i = 0; i < allObjects.Count; i++)
        {
            float yPos = i * 35;
            pos = new Vector3(0, -yPos);

            GameObject bouton = Instantiate(bouton_liste);
            bouton.name = "bouton_" + allObjects[i].name;
            bouton.transform.SetParent(ObjectParent.transform);
            bouton.GetComponent <RectTransform>().anchoredPosition = pos;

            Text bouton_texte         = bouton.GetComponentInChildren <Text>();
            ObjectsInformations infos = allObjects[i].GetComponent <ObjectsInformations>();

            bouton.GetComponent <bouton_hierarchyList>().object_linked = allObjects[i];

            bouton_texte.text = infos.title;

            if (i % 2 == 0)
            {
                bouton.GetComponent <Image>().color = col;
            }



            Canvas.ForceUpdateCanvases();
        }
    }
    void Start()
    {
        readObjects = GameObject.Find("CSV_objets_lecture").GetComponent <ReadObjects>();

        allObjects           = readObjects.allObjects;
        spatializedObjects   = readObjects.spatializedObjects;
        noSpatializedObjects = readObjects.noSpatializedObjects;

        PlacerLesObjets();

        offsetX_check = offsetX;
        offsetZ_check = offsetZ;
        coordonates_Multiplicater_check = coordonates_Multiplicater;
    }
Exemplo n.º 3
0
    void Start()
    {
        readObjects = GameObject.Find("CSV_objets_lecture").GetComponent <ReadObjects>();
        allObjects  = readObjects.allObjects;


        for (var i = 0; i < allObjects.Count; i++)
        {
            GameObject          obj   = allObjects[i];
            ObjectsInformations infos = obj.GetComponent <ObjectsInformations>();

            GameObject obj_label = Instantiate(label_prefab);
            obj_label.name = "label_" + obj.name;
            obj_label.tag  = "Label";
            obj_label.transform.SetParent(gameObject.transform);
            obj_label.transform.position = obj.transform.position;

            obj_label.GetComponentInChildren <Text>().text = infos.title;
            obj_label.GetComponentInChildren <CameraFacingBillboard>().m_Camera = GameObject.Find("Main Camera").GetComponent <Camera>();

            infos.label = obj_label;
        }
    }