} // End BuildPsd() private static void parseComponent(GameObject root) { string layerName = root.name; List <Word> parseWords = WordParser.BindingParse(root, layerName); int childCount = root.transform.childCount; for (int i = childCount - 1; i >= 0; i--) { Transform childTrans = root.transform.GetChild(i); parseComponent(childTrans.gameObject); } WordParser.exitBindingParse(parseWords, root, layerName); }
public string GetLayerPath(string layerName) { // string assetPath = FullFileName; // string directoryPath = Path.GetDirectoryName(assetPath); // // string layerFile = Path.GetFileNameWithoutExtension(assetPath); // layerFile = string.Format("{0}_{1}.png", layerFile, layerName); // string layerPath = Path.Combine(directoryPath, layerFile); string[] exportNameAndPath = WordParser.GetTextureExportPath(layerName); string basePath = string.Format("Assets/{0}", exportNameAndPath[1]); if (!Directory.Exists(basePath)) { Directory.CreateDirectory(basePath); } string imgPath = string.Format("{0}.png", exportNameAndPath[0]); string layerPath = Path.Combine(basePath, imgPath); return(layerPath); }