Ejemplo n.º 1
0
    int GetInListDbIndex(List <EditableElements> L, SectionDataBase sdb)
    {
        int retorno = -1;

        for (int i = 1; i < L.Count; i++)
        {
            Debug.Log(sdbc.GetChangebleElementWithId(L[i].member) + " : " + L[i].member + " : " + L[i].type);

            ChangebleElement changeE = sdbc.GetChangebleElementWithId(L[i].member)[L[i].outIndex];

            if (changeE.subsection.Length > 0)
            {
                if (changeE.subsection[L[i].inIndex] == sdb)
                {
                    retorno = i;
                }
            }
        }

        return(retorno);
    }
Ejemplo n.º 2
0
    void VerifySubSections(List <EditableElements> L, SectionDataBase target, int deep)
    {
        if (!VerifyActiveDbView(target))
        {
            return;
        }


        int dbIndex = secManager.GetActiveIndexOf(target);

        if (dbIndex == -1)
        {
            Debug.Log("Não encontrada referencia no sectionManager para : " + target);
            return;
        }

        int inListIndex = GetInListDbIndex(L, target);

        ChangebleElement changeE = sdbc.GetChangebleElementWithId(target)[dbIndex];


        List <EditableElements> forInsert = new List <EditableElements>();

        if (changeE is SimpleChangebleMesh || changeE is CombinedChangebleMesh)
        {
            forInsert.Add(new EditableElements()
            {
                mySDB       = target,
                displayName = DeepView(deep) + "Type",
                inIndex     = 0,
                outIndex    = dbIndex,
                member      = target,
                type        = EditableType.mesh
            });
        }
        else if (changeE is MaskedTexture)
        {
            forInsert.Add(new EditableElements()
            {
                mySDB       = target,
                displayName = DeepView(deep) + "Detail",
                inIndex     = 0,
                outIndex    = dbIndex,
                member      = target,
                type        = EditableType.texture
            });
        }

        int contCores = 0;

        for (int i = 0; i < changeE.coresEditaveis.Length; i++)
        {
            if (changeE.coresEditaveis[i].registro != RegistroDeCores.skin)
            {
                contCores++;
                forInsert.Add(new EditableElements()
                {
                    mySDB       = target,
                    displayName = DeepView(deep) + "Cor " + contCores,
                    inIndex     = i,
                    outIndex    = dbIndex,
                    member      = target,
                    type        = EditableType.color
                });
            }
        }

        SectionDataBase[] s = changeE.subsection;

        for (int i = 0; i < s.Length; i++)
        {
            forInsert.Add(new EditableElements()
            {
                mySDB       = s[i],
                displayName = DeepView(deep) + " " + s[i].ToString(),
                inIndex     = i,
                outIndex    = 0,
                member      = target,
                type        = EditableType.control
            });
        }

        L.InsertRange(inListIndex + 1, forInsert);



        if (s.Length > 0)
        {
            for (int i = 0; i < s.Length; i++)
            {
                VerifySubSections(L, s[i], deep + 1);
            }
        }
    }