Inheritance: CommandBase
    public void BuildPanel()
    {
        int profondeur;

        SpiroParametrableActive = Spirographe.GetActiveObject();
        SelectedLine            = Spirographe.GetActiveSpiroFormule();
        if (SelectedLine == null)
        {
            profondeur = 0;
        }
        else
        {
            profondeur = SelectedLine.profondeur;
        }
        int NbLignesCrees = PanelLignes.transform.childCount;

        for (int i = 0; i < profondeur; i++)
        {
            if (i < NbLignesCrees)
            {
                LineCurr = PanelLignes.transform.GetChild(i).gameObject;
                LineCurr.SetActive(true);
            }
            else
            {
                TextNumeroDisque.GetComponent <Text>().text = (i + 1).ToString();
                InitField(ref IFR, i);
                InitField(ref IFRO, i);
                InitField(ref IFA, i);
                InitField(ref IFV, i);
                InitField(ref IFP, i);
                InitField(ref IFF, i);
                ToggleAnimation.GetComponent <ToggleAnimRayon>().index = i;
                ToggleAnimation.GetComponent <ToggleAnimRayon>().RefreshContent();
                ToggleActiveDisque.GetComponent <ToggleRotAxe>().index = i;
                ToggleActiveDisque.GetComponent <ToggleRotAxe>().RefreshContent();
                GameObject NewLine = Instantiate(LigneSpiro);
                NewLine.name = "Ligne" + (i).ToString();
                NewLine.SetActive(true);
                NewLine.transform.SetParent(PanelLignes.transform, false);
            }
        }
        //Reste à cacher les lignes restantes éventuelles :
        if (profondeur <= NbLignesCrees)
        {
            for (int i = profondeur; i < NbLignesCrees; i++)
            {
                PanelLignes.transform.GetChild(i).gameObject.SetActive(false);
            }
        }

        //Gestion affichage des coches RotAxe

        for (int i = 1; i < profondeur - 1; i++)
        {
            GetBackgroundActivation(i).SetActive(true);                 //on l'affiche
        }
        GetBackgroundActivation(0).SetActive(false);                    //on le cache
        GetBackgroundActivation(profondeur - 1).SetActive(false);       //on le cache

        RefreshFacteurTransmission();
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a handle for the control.
 /// </summary>
 protected override void CreateHandle()
 {
     base.CreateHandle();
     ToggleAnimation.Start();
 }