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

能联系做仿瓷的网站桂林网络开发

能联系做仿瓷的网站,桂林网络开发,win系统的wordpress,无锡网站建设 首选无锡立威云商最近写了个替换系统图片资源的工具#xff0c;拖拽项目内图片资源路径文件夹#xff0c;会生成显示图片缩略图和名字的item#xff0c;在右侧把需要替换的图片拖进来点击确定就可以了#xff0c;主要是省了重命名这一步 using System.Collections; using System.Collectio…最近写了个替换系统图片资源的工具拖拽项目内图片资源路径文件夹会生成显示图片缩略图和名字的item在右侧把需要替换的图片拖进来点击确定就可以了主要是省了重命名这一步 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; using System.IO; public Class MyItem {public string name;public Texture2D image;public Texture2D draggedTex;public string draggedTexName;public string path;public MyItem(){name ;image null;draggedTex null;} } public class ImageReplace: EditorWindow {[MenuItem(Window/ImageReplace)]public static void OpenWindow(){var win GetWindom(ImageReplace)();win.titleContent new GUIContent(Image Place);win.Show();}private ListMyItem items new ListMyItem();private string folderPath;private Vector2 ScrollPosition; void OnGUI(){GUILayout.Label(Drop an Image file here, EditorStyles.boldLabel);Event currentEvent Event.current;Rect dropArea GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));switch (currentEvent.type){case EventType.DragUpdated:case EventType.DragPerform:if (!dropArea.Contains(currentEvent.mousePosition))break;DragAndDrop.visualMode DragAndDropVisualMode.Copy;if (currentEvent.type EventType.DragPerform){DragAndDrop.AcceptDrag();foreach (var path in DragAndDrop.paths){if(File.GetAttributes(path).HasFlag(FileAttributes.Directory)){var allFiles Directory.GetFiles(path,*.*,SearchOption.AllDirectories);{foreach(var file in allFiles){if(Path.GetExtension(file) .png || Path.GetExtension(file) .jng ){CreateItem(file);}}}}else{if(Path.GetExtension(file) .png || Path.GetExtension(file) .jng ){CreateItem(file);}}}}Event.current.Use();break;}GUILayout.Space(10);scrollPosition GUILayout.BeginScrollView(scrollPosition);foreach (var item in items){GUILayout.BeginHorizontal();GUILayout.Label(item.name,GUILayout.Width(200));GUILayout.Box(item.image,GUILayout.Width(100),GUILayout.Height(100));GUIStyle style new GUIStyle();style.normal.textColor Color.white;Rect dropArea2 GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, GUILayout.Width(100),GUILayout.Height(100));Event dropEvent Event.current;switch (dropEvent .type){case EventType.DragUpdated:case EventType.DragPerform:if (!dropArea.Contains(dropEvent .mousePosition))break;DragAndDrop.visualMode DragAndDropVisualMode.Copy;if (currentEvent.type EventType.DragPerform){DragAndDrop.AcceptDrag();foreach (var path in DragAndDrop.paths){if(Path.GetExtension(file) .png || Path.GetExtension(file) .jng ){Texture2D tex new Texture2D (2,2);tex.LoadImage(File.ReadAllBytes(path));item.draggedTex tex;item.draggedTexName Path.GetFileName(path);}}}dropEvent .Use();break;}GUILayout.Box(item.draggedTex,GUILayout.Width(100),GUILayout.Height(100));GUILayout.EndHorizontal();}GUILayout.EndScrollView();GUILayout.Space(10);GUILayout.BeginHorizontal();if(GUILayout.Button(确定)){ApplyChanges();}if(GUILayout.Button(清除)){ClearItems();}GUILayout.EndHorizontal();}private void CreateItem(string file){MyItem newItem new MyItem{name Path.GetFileName(file);path file;image AssetDatabase.LoadAssetAtPathTexture2D(file);}items.Add(newItem);}private void ApplyChanges(){foreach (var item in items){if(item.draggedTex){byte[] imgBytes item.draggedTex.EncodeToPNG();File.WriteAllBytes(item.path,imgBytes );}}Debug.Log(Finish);}private void ClearItems(){items.Clear();} }
http://www.zqtcl.cn/news/900876/

相关文章:

  • 梅州建设网站域名购买流程
  • 单页网站与传统网站的区别wordpress对接微信
  • 做公司网站深圳旅游
  • 最好企业网站网站建设 的销售图片
  • 怎么创建网站 免费滴做网站算运营吗
  • 廊坊网站建设-商昊网络正规网站优化推广
  • 网站建设拍金手指排名贰贰安装wordpress数据库错误
  • 食品网站建设需求分析购物app大全
  • 电商美工广州seo技术外包公司
  • 重庆旅游seo整站优化深圳宝安区是富人区吗
  • 网站开发验收模板网站欧美风格
  • 自己做发卡网站什么是网络设计制作
  • 如何搭建一个公司网站互联网推广怎么找客户
  • 江苏同隆建设集团有限公司网站asp.net新建网站
  • 爱站网挖掘工具小程序网站开发怎么样
  • 网站文章批量上传工具自己制作免费网站
  • 凡科快速建站建设网站遇到问题的解决方案
  • 深圳市公司网站建设公司十大互联网营销公司
  • 免费发布推广信息的网站百度招聘2022年最新招聘
  • 建站公司怎么获客任县附近网站建设价格
  • 泰兴市淘宝网站建设指数 网站权重
  • 烟台市做网站找哪家好才艺多网站建设
  • nginx wordpress 重写seo技术大师
  • 公司网站建设需要什么科目上海服务政策调整
  • 如何免费搭建自己的网站网站建设公司swot分析
  • 太原网站优化技术如何开发一款app软件
  • 莆田做网站公司lnmp wordpress 404
  • 网站开发中的qq登录网站地图有什么作用
  • 南宁小程序开发网站建设公司网络营销方案设计范文
  • 电脑做网站主机空间哈尔滨人才招聘信息网