예제 #1
0
    public void AddLine()
    {
        int i;

        SelectedLine = Spirographe.GetActiveSpiroFormule();
        SelectedLine.profondeur++;
        i = SelectedLine.profondeur - 1;     //avant dernière ligne avant le crayon
        TextNumeroDisque.GetComponent <Text>().text = (i + 1).ToString();
        int NbLignesCrees = PanelLignes.transform.childCount;

        if (NbLignesCrees < SelectedLine.profondeur)
        {
            IFR.GetComponent <InputField>().GetComponent <InputFieldPanelDisques>().index = i;
            IFR.GetComponent <InputField>().GetComponent <InputFieldPanelDisques>().RefreshContent();
            IFF.GetComponent <InputField>().GetComponent <InputFieldPanelDisques>().index = i;
            IFF.GetComponent <InputField>().GetComponent <InputFieldPanelDisques>().RefreshContent();
            IFRO.GetComponent <InputField>().GetComponent <InputFieldPanelDisques>().index = i;
            IFRO.GetComponent <InputField>().GetComponent <InputFieldPanelDisques>().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);
        }
        else
        {
            PanelLignes.transform.GetChild(i).gameObject.SetActive(true);
        }
        RefreshPanel();
        //PanelOptionTousDisques.GetComponent<PanelOptionTousDisques>().BuildPanel(); //refresh panel tous disques too
        Spirographe.ValueChange();         //Call ValueChange Event
    }
예제 #2
0
    public void BuildPanel()
    {
        int        profondeur;
        GameObject LineCurr;         //

        //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();
                IFR.GetComponent <InputFieldPanelDisques>().index = i;
                IFR.GetComponent <InputFieldPanelDisques>().RefreshContent();
                IFR.GetComponent <InputFieldPanelDisques>().Start();
                IFF.GetComponent <InputFieldPanelDisques>().index = i;
                IFF.GetComponent <InputFieldPanelDisques>().RefreshContent();
                IFF.GetComponent <InputFieldPanelDisques>().Start();
                IFRO.GetComponent <InputFieldPanelDisques>().index = i;
                IFRO.GetComponent <InputFieldPanelDisques>().RefreshContent();
                IFRO.GetComponent <InputFieldPanelDisques>().Start();
                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);
            }
        }
        GetComponent <RectTransform>().ForceUpdateRectTransforms();
        //Debug.Log("Building Panel big");
        //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

        /*if (profondeur>0)
         * {
         *      RefreshCochesActivation();
         *      RefreshFacteurTransmission();
         * }*/
        RefreshPanel();
    }