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

南宁企业建站程序找网络公司建网站的流程

南宁企业建站程序,找网络公司建网站的流程,网站建设适用税种,网站建设方案 预算以下内容是根据Unity 2020.1.0f1版本进行编写的   实现一个自定义图集,该怎么入手呢。首先简单思考一下unity是怎么实现图集的。 因为unity的ui部分是开源的,所以我们可以看到UGUI的源代码,另外,Unity的内置Shader也是开源的,可以直接在官网下载(在下载的网页选择Built…以下内容是根据Unity 2020.1.0f1版本进行编写的   实现一个自定义图集,该怎么入手呢。首先简单思考一下unity是怎么实现图集的。 因为unity的ui部分是开源的,所以我们可以看到UGUI的源代码,另外,Unity的内置Shader也是开源的,可以直接在官网下载(在下载的网页选择Built in shaders下载即可):https://unity.com/releases/editor/archive 首先,图集在Unity编辑器中是可编辑的,因此,需要实现一个自定义图集的Inspector面板,并定义好图集的基础属性,方便使用。 1、实现自定义图集类MyAtlas using System.Collections.Generic; using UnityEngine;[CreateAssetMenu(fileName = "MyAtlas", menuName = "My Atlas")] public class MyAtlas : ScriptableObject {public string atlasName = "";public Liststring guids = new Liststring();public Liststring packableObjects = new Liststring();public Liststring realPackObjs = new Liststring();public ListUnityEngine.Object objs = new ListObject(); }首先,定义自定义的图集类MyAtlas,这里只定义Inspector面板需要用到的变量。需要继承ScriptableObject类,否则无法实现自定义类型的后处理导入 其中,atlasName是图集名字,guids是图集包含全部图片的guid,realPackObjs是图集包含全部图片的路径,Objs是显示在Inspector面板的Object,packableObjects是Objs对应的路径,因为有可能是文件夹,所以需要和realPackObjs区分开来。 右键新建一个MyAtlas文件,如上图,这样可以了   2、实现自定义图集类的Inspector面板 using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Security.Cryptography; using UnityEngine;public class CommonFunc : MonoBehaviour {public static void SeachFile(string path, Liststring files, string[] extensions){if (Directory.Exists(path)){DirectoryInfo di = new DirectoryInfo(path);FileSystemInfo[] fsInfos = di.GetFileSystemInfos();bool isSkip;foreach (FileSystemInfo fsInfo in fsInfos){isSkip = true;if (fsInfo is DirectoryInfo){SeachFile(fsInfo.FullName, files, extensions);}if (fsInfo.Name.Contains(".meta")){continue;}foreach (string extension in extensions){if (fsInfo.Name.Contains(extension)){isSkip = false;break;}}if (!isSkip){string fileN = fsInfo.FullName;string ss = "Assets" + fileN.Replace("\\", "/").Replace(Application.dataPath, "");if (!files.Contains(ss)){files.Add(ss);}}}}}public static Liststring GetAllFilesInDirectory(string path, string searchParttern, Liststring list = null, bool isUnityPath = false){if (list == null){list = new Liststring();}var files = Directory.GetFiles(path, searchParttern, SearchOption.AllDirectories);foreach (var file in files){string filePath = file.Replace("\\", "/");if (isUnityPath){filePath = GetUnityPath(filePath);}list.Add(filePath);}return list;}public static string GetMD5Hash(string filePath){MD5 md5 = new MD5CryptoServiceProvider();return BitConverter.ToString(md5.ComputeHash(File.ReadAllBytes(filePath))).Replace("-", "").ToLower();}public static string GetUnityPath(string path){string newPath = path;if (newPath.Contains(Application.dataPath)){newPath = newPath.Replace(Application.dataPath, "Assets");}if (newPath.Contains(Application.dataPath.Replace("/", "\\"))){newPath = newPath.Replace(Application.dataPath.Replace("/", "\\"), "Assets");}if (newPath.Contains(Application.dataPath.Replace("\\", "/"))){newPath = newPath.Replace(Application.dataPath.Replace("\\", "/"), "Assets");}newPath = newPath.Replace("\\", "/");return newPath;}public static string GetSystemPath(string path){string newPath = path;if (newPath.StartsWith("Assets")){newPath = Application.dataPath.Replace("Assets", "") + newPath;}newPath = newPath.Replace("/", "\\");return newPath;}public class Messagebox{[DllImport("User32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]public static extern int MessageBox(IntPtr handle, String message, String title, int type);} }首先实现一个通用的类CommonFunc,包含一些通用方法,如文件路径转换UnityPath,或者转换为系统路径,等等。 using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEditor.UI; using UnityEditorInternal; using UnityEngine;[
http://www.hkea.cn/news/14340239/

相关文章:

  • php网站开发笔试题沈阳工程招标信息网
  • 建设银行宁波分行 招聘网站做网站的外部链接关系分析的工具
  • 展示型网站设计方案梧州红豆论坛
  • 四川省优质校建设 网站滁州做网站的公司
  • 连接外国的网站吗网站开发与iso9001关系
  • 小型企业做网站的价格企业展示型网站 建站系统
  • 西宁专业做网站公司做网站应该了解什么
  • 怎么做外卖网站简网app工场的制作入口
  • 帮人做网站要怎么赚钱登录网站怎么做
  • 济南槐荫区做网站的寻找做项目的网站
  • 服装设计网站免费目前哪些企业需要做网站建设的呢
  • 网站图片上传不上去怎么办wordpress漏洞
  • 德育工作网站建设方案网站建设财务计划与预测
  • 创建网站要多长时间普陀做网站公司
  • 品牌网站设计制作多少钱灯塔网站建设
  • 中小企业网站响应式网站建设特征
  • 怎样做彩票投资网站新建设网站如何推广
  • phpcms v9 网站搬家企业门户网站建设案例
  • 如何找到网站管理员宁波建设系统网站
  • 手机网站搭建建筑企业网站模板
  • seo优化网站优化wordpress视频没图像
  • 网站网页制作及优化wordpress前端开发
  • 1150网站建设服务器主板下载建设app
  • 网站开发备案vps上创建网站
  • 晋江做网站的公司wordpress 抄袭查询
  • 阿里云配置网站境外直播app
  • 做网站的市场风险分析及对策网站企业推广方案
  • 宁波网站建设培训打造一个网站
  • 北京微网站制作手机房屋设计软件app
  • 电商网站支付体系建设特点移动网站建设流程