Exemple #1
0
    public override void UpdateElement()
    {
        Vector2 contentRealEstate = ContentRealEstate();

        Vector2 nextElementPos = FirstElementPos();

        for (int elementIndex = 0; elementIndex < content.Count; elementIndex++)
        {
            GameObject element = content[elementIndex];

            Vector2 elementSize = ElementSize(elementIndex);
            nextElementPos = CenterElement(nextElementPos, elementSize);

            ElementController EC = element.GetComponent <ElementController>();

            if (EC != null)
            {
                EC.PlaceElement(elementSize, nextElementPos);
            }
            else
            {
                element.GetComponent <RectTransform>().sizeDelta = elementSize;
                element.transform.localPosition = nextElementPos;
            }

            nextElementPos = NextElementStart(nextElementPos, elementSize);
        }
    }