Esempio n. 1
0
    void CreateSectionButton()
    {
        GameObject inst = Instantiate(sectionButtonPrefab);

        inst.transform.parent = this.transform;

        SectionButton sb = inst.GetComponent <SectionButton>();

        sb.SetSection(sections.Count - 1);
        sectionButtons.Add(sb);

        SetButtonPositions();
    }
Esempio n. 2
0
    public void CreateSectionButtons()
    {
        for (int i = 0; i < sections.Count; i++)
        {
            GameObject inst = Instantiate(sectionButtonPrefab);
            inst.transform.parent = this.transform;
            float xPos = (maxSections - sections.Count) / 2 + i;
            inst.transform.localPosition = new Vector3(xPos, 0, 0);

            SectionButton sb = inst.GetComponent <SectionButton>();
            sb.SetSection(i);
            sectionButtons.Add(sb);
        }
    }