示例#1
0
 public GroupNodeItem Analyzing(RuleObject Rule, string name)
 {
     string[] areguments = null;
     this.displayName = Rule.AnalysisGroupName(name, out data.suffix, out areguments);
     if (layerImporter == null)
     {
         layerImporter = Rule.layerImports.Where(x => x.Suffix == data.suffix).FirstOrDefault();
         if (layerImporter == null)
         {
             layerImporter = ScriptableObject.CreateInstance <UGUI.PanelLayerImport>();
         }
     }
     layerImporter.AnalysisAreguments(data, areguments);
     return(this);
 }
示例#2
0
        public GroupNode Analyzing(RuleObject Rule, string name)
        {
            string[] areguments = null;
            this.displayName = Rule.AnalysisGroupName(name, out groupType, out areguments);
            switch (groupType)
            {
            case GroupType.GRID:
                if (areguments != null && areguments.Length > 1)
                {
                    var key = areguments[0];
                    direction = RuleObject.GetDirectionByKey(key);
                }
                if (areguments != null && areguments.Length > 2)
                {
                    var key = areguments[1];
                    constraintCount = int.Parse(key);
                }
                break;

            case GroupType.SCROLLVIEW:
            case GroupType.SLIDER:
            case GroupType.SCROLLBAR:
                if (areguments != null && areguments.Length > 0)
                {
                    var key = areguments[0];
                    direction = RuleObject.GetDirectionByKey(key);
                }
                break;

            case GroupType.GROUP:
                if (areguments != null && areguments.Length > 1)
                {
                    var key = areguments[0];
                    direction = RuleObject.GetDirectionByKey(key);
                }
                if (areguments != null && areguments.Length > 2)
                {
                    var key = areguments[1];
                    spacing = float.Parse(key);
                }
                break;

            default:
                break;
            }
            return(this);
        }
示例#3
0
 public static Texture GetPreviewIcon(PreviewItem item, RuleObject rule)
 {
     RuleObj = rule;
     if (rule == null || item.layerType != LayerType.Group)
     {
         return(previewIcons[item.layerType.ToString()]);
     }
     else
     {
         string   groupType = PSDUnityConst.emptySuffix;
         string[] args;
         rule.AnalysisGroupName(item.name, out groupType, out args);
         if (!previewIcons.ContainsKey(groupType))
         {
             previewIcons[groupType] = LoadTexture(groupType);
         }
         return(previewIcons[groupType]);
     }
 }