当前位置: 首页 > news >正文

广州网站建设weeken做做网页

广州网站建设weeken,做做网页,郑州网站哪家好,简单房地产网站在哪用odin实现了一个资源复制编辑器,使用要安装odin,功能是把要复制的资源路径一个个添加设置,点copy能把列表里的资源全部复制,支持目录复制到目录,文件复制到目录,文件复制替换。提升效率,让自己…

用odin实现了一个资源复制编辑器,使用要安装odin,功能是把要复制的资源路径一个个添加设置,点copy能把列表里的资源全部复制,支持目录复制到目录,文件复制到目录,文件复制替换。提升效率,让自己有更多的时间研究其他东西或者休息,需要注意的是只有一个目标路径的情况下,不能同时填源文件路径和源文件夹路径,不然不知道要拷贝文件还是文件夹,这个应该很好理解吧。代码如下:

using UnityEditor;
using UnityEngine;
using Sirenix.OdinInspector.Editor;
using Sirenix.OdinInspector;
using System;
using System.IO;
using System.Collecttions.Generic;
public class PathTableListWindow : OdinEditorWindow
{[MenuItem("Window/Open Path Table List")]private static void OpenWindow(){// GetExistingOrCreateNewWindow 是一个用于创建或获取已存在窗口的辅助方法var window = GetWindow<PathTableListWindow>();window.Show();}// 示例数据,用于在编辑器窗口中显示[TableList]public List<Item> PathItems = new List<Item>();[Button("Copy")]private void CopyAssets(){foreach(var item in PathItems){if (Directory.Exists(item.SourcePath)){// 如果源路径是文件夹,则递归复制所有文件和子文件夹CopyDirectory(item.SourcePath, item.TargetPath);}else if (File.Exists(item.SourcePath)){// 如果源路径是文件,则直接复制文件string destDir = Path.GetDirectoryName(item.TargetPath);if (!Directory.Exists(destDir)){Directory.CreateDirectory(destDir);}File.Copy(item.SourcePath, item.TargetPath, true);}if(!string.IsNullOrEmpty(item.SourceFilePath)){if(string.IsNullOrEmpty(item.TargetFilePath){var destFile = Path.Combine(item.TargetPath,Path.GetFileName(item.TargetFilePath));File.Copy(item.SourceFilePath, destFile, true);}else{File.Copy(item.SourceFilePath, item.TargetFilePath, true);}}}}private void CopyDirectory(string source, string destination){if(File.GetAttributes(source).HasFlag(FileAttributes.Directory)){string targetDest = Path.Combine(destination,Path.GetFileName(source));if(!Directory.Exists(targetDest)){// 创建目标目录Directory.CreateDirectory(targetDest );}// 递归复制子目录string[] dirs = Directory.GetDirectories(source);foreach (string dir in dirs){string destDir = Path.Combine(targetDest, Path.GetFileName(dir));CopyDirectory(dir, destDir);}// 获取源目录下的所有文件string[] files = Directory.GetFiles(source);foreach (string file in files){string destFile = Path.Combine(targetDest, Path.GetFileName(file));File.Copy(file, destFile, true);}}else{// 获取源目录下的所有文件string[] files = Directory.GetFiles(source);foreach (string file in files){string destFile = Path.Combine(destination, Path.GetFileName(file));File.Copy(file, destFile, true);}}}[System.Serializable]public class Item{[TableColumnWidth(60)][FolderPath, PropertyOrder(-1),HorizontalGroup("资源路径列表",0.25f)]public string SourcePath;[FolderPath, PropertyOrder(-1),HorizontalGroup("资源路径列表",0.25f)]public string TargetPath;[FilePath, PropertyOrder(-2),HorizontalGroup("资源路径列表",0.25f)]public string TargeFiletPath;[FilePath, PropertyOrder(-2),HorizontalGroup("资源路径列表",0.25f)]public string SourceFilePath;}
}
http://www.yayakq.cn/news/477423/

相关文章:

  • 丹东电信网站备案网站建设与规划工作
  • 天津网络网站制作企业官方网站需要备案吗
  • 网站开发需多少钱上海开发网站
  • 网站主机的类型wordpress 显示页面
  • 企业网站的推广方法网站统计平台
  • 建设一个企业网站wordpress wp_list_categories()
  • 做网站手机验证收费吗客户关系管理
  • 网站建设服务商的网站建设流程wordpress采集后排版
  • 做初中数学题的网站免费行情软件网站下载大全爱
  • 哪里有做投票的网站沈阳做网站怎样收费
  • 百度关键词搜索引擎排名优化合肥网站推广优化公司
  • 建设商城网站多少钱wordpress适合中国的小插件介绍
  • 现在石家庄做网站的公司有哪几家wordpress 主题函数
  • 网站开发销售话术电商网站首页
  • 抓取wordpress站点用户万荣网站seo
  • 做网站现在什么尺寸合适电商平台取名字大全
  • 瑞安 网站建设培训万户网络oa
  • 基于html做电商网站论文wordpress 为静态
  • 专门做钻石国外网站苏州做网站要多少钱
  • 织梦做的网站打开慢龙岩网站制作公司
  • 国外域名网站推荐wordpress网站换空间
  • 服务器有了网站怎么做的最近的新闻热点事件
  • 装饰设计公司名字seo华为网站诊断报告
  • 东台建设局官方网站做房产的有哪些网站
  • 做网站寄生虫什么叫关键词举例
  • 网站文章要求足球网站模板
  • 网站建设销售简历黑龙江两学一做网站
  • 汽车网站建设流程南宁网站建设公司如何为老板打造网站赚钱的
  • 茂名东莞网站建设湛江网页设计开发
  • 河北手机网站制作多少钱手机网站开发成为小程序