예제 #1
0
 //图像和text
 private static void ExportLayer(Layer layer, UINode parentNode) //
 {
     if (!layer.IsTextLayer)
     {
     }
     else
     {
         UINode node = PsdControl.CreateUIText(layer);
         parentNode.children.Add(node);
     }
 }
예제 #2
0
        private static void ExportGroup(Layer layer, UINode parentNode)
        {
            GroupClass groupClass = PsdControl.CheckGroupClass(layer);
            UINode     node       = null;

            if (groupClass == GroupClass.Image)
            {
                node = PsdControl.CreateImage(layer);
            }
            else if (groupClass == GroupClass.RectTransform)
            {
                node = PsdControl.CreateRectTransform(layer);
            }
            else if (groupClass == GroupClass.Progress)
            {
                node = PsdControl.CreateProgress(layer);
            }
            else if (groupClass == GroupClass.Texture)
            {
                node = PsdControl.CreateImage(layer, true);
            }
            else if (groupClass == GroupClass.Button)
            {
                node = PsdControl.CreateUIButton(layer);
            }
            else if (groupClass == GroupClass.ScrollRect)
            {
                node = PsdControl.CreateScrollRect(layer);
            }
            else if (groupClass == GroupClass.Empty)
            {
                return;
            }
            else
            {
                return;
            }
            //添加了node
            if (node != null)
            {
                parentNode.children.Add(node);
                ExportTree(layer.Children, node);
            }
        }