Esempio n. 1
0
        public static void registWord()
        {
            // 参数绑定解析
            importParser["name"]   = new NameBinder();
            importParser["img"]    = new ImageBinder();
            importParser["ignore"] = new IgnoreBinder();
            importParser["font"]   = new FontBinder();
            // 脚本组件
            if (PsdSetting.Instance.curGUIType == GUIType.UGUI)
            {
                importParser["button"]     = new ButtonBinder();
                importParser["toggle"]     = new ToggleBinder();
                importParser["slider"]     = new SliderBinder();
                importParser["scrollview"] = new ScrollViewBinder();
                importParser["scrollbar"]  = new ScrollbarBinder();
                importParser["inputfield"] = new InputFieldBinder();
            }
            else if (PsdSetting.Instance.curGUIType == GUIType.NGUI)
            {
                importParser["button"]     = new NButtonBinder();
                importParser["toggle"]     = new NToggleBinder();
                importParser["slider"]     = new NSliderBinder();
                importParser["scrollview"] = new NScrollViewBinder();
                importParser["scrollbar"]  = new NScrollbarBinder();
                importParser["inputfield"] = new NInputFieldBinder();
                importParser["texture"]    = new NTextureBinder();
                importParser["tmpt"]       = new NTempletBinder();
            }

#if NGUI
            NAtlasHelper.LoadAllAtlas(PsdSetting.Instance.AtlasImportFolder);
#endif
            NTempletHelper.LoadAllTemplet(PsdSetting.Instance.TempletImportFolder);
        }
Esempio n. 2
0
        public static 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 = ImageBinder.GetTextureExportPath(layerName);
            if (exportNameAndPath == null)
            {
                return(null);
            }

            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);
        }