Ejemplo n.º 1
0
    public void Build(ModelTexture mtex)
    {
        if (mtex == null)
        {
            return;
        }
        Grid.Clear();
        Grid.AddElement(Instantiate(HLine));
        Variant variant = mtex.GetParent <Variant>();

        foreach (ModelTexture sibling in variant.Children <ModelTexture>())
        {
            if (sibling != mtex)
            {
                ARColorIcon icon = MakeIcon();
                icon.modeltexture       = sibling;
                icon.ColorIcon.Selected = sibling == mtex;
                icon.ClickBox.AddEventListener("onclick", () => {
                    if (OnSelect != null)
                    {
                        OnSelect(sibling);
                    }
                });
                Grid.AddElement(icon);
                Grid.AddElement(Instantiate(HLine));
            }
        }
    }
Ejemplo n.º 2
0
    private ARColorIcon MakeIcon()
    {
        GameObject  iconGO = Instantiate(ColorIconPrefab);
        ARColorIcon icon   = iconGO.GetComponent <ARColorIcon>();

        if (icon == null)
        {
            Destroy(iconGO);
            return(null);
        }
        return(icon);
    }