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

注销主体备案与网站备案表淘宝客网站一般用什么做的

注销主体备案与网站备案表,淘宝客网站一般用什么做的,简历模板免费下载的网页,在本地搭建wordpress推荐阅读 CSDN主页GitHub开源地址Unity3D插件分享简书地址 大家好#xff0c;我是佛系工程师☆恬静的小魔龙☆#xff0c;不定时更新Unity开发技巧#xff0c;觉得有用记得一键三连哦。 一、前言 【GameFramework框架】系列教程目录#xff1a; https://blog.csdn.net/q7… 推荐阅读 CSDN主页GitHub开源地址Unity3D插件分享简书地址 大家好我是佛系工程师☆恬静的小魔龙☆不定时更新Unity开发技巧觉得有用记得一键三连哦。 一、前言 【GameFramework框架】系列教程目录 https://blog.csdn.net/q764424567/article/details/135831551 最近好忙鸽了好久。不能颓废了继续发力。 今天分享的是GF框架的File System文件系统。 二、正文 2-1、介绍 首先引用比较官方的说法 GF的FileSystem虚拟文件系统使用类似磁盘存储的感念对零散的文件进行集中管理优化资源加载时产生的内存分配也可以对资源进行局部片段加载极大的提升了资源加载的性能。 通俗点讲就是我这个模块就是加载磁盘文件的优化加载时产生的内存分配。 那么它是怎么优化的呢 比如说一个文件夹里面有几千个文件传输的话会非常的慢因为普通的文件系统是一个一个读取写入每次读取写入都是一次磁盘IO所以花费大量时间而这个文件系统将会将整个文件夹当成一个压缩包然后再进行读取写入那么就减少了大量的IO提高了性能。 2-2、使用说明 查看文件是否存在 using GameFramework.FileSystem; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityGameFramework.Runtime;public class TestFileSystem : MonoBehaviour {void Start(){FileSystemComponent fileSystemComponent GameEntry.GetComponentFileSystemComponent();string fullPath System.IO.Path.Combine(Application.persistentDataPath, FileSystem.dat); 检查是否存在文件系统参数要传递的是文件系统的完整路径bool hasFileSystem fileSystemComponent.HasFileSystem(fullPath);Debug.Log(hasFileSystem);} }读写文件: using GameFramework.FileSystem; using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using UnityGameFramework.Runtime;public class TestFileSystem : MonoBehaviour {void Start(){FileSystemComponent fileSystemComponent GameEntry.GetComponentFileSystemComponent();// 要创建的文件系统的完整路径string fullPath Path.Combine(Application.persistentDataPath, FileSystem.dat);// 要创建的文件系统最大能容纳文件数量int maxFileCount 16;// 要创建的文件系统最大能容纳的块数据数量int maxBlockCount 256;// 创建文件系统使用读写模式进行访问IFileSystem fileSystem fileSystemComponent.CreateFileSystem(fullPath, FileSystemAccess.ReadWrite, maxFileCount, maxBlockCount);// 将字节数组写入指定文件byte[] buffer new byte[1024]; // 读取文件片段使用的 buffer用此方式能够复用 buffer 来消除 GCAllocbool result fileSystem.WriteFile(FileName.dat, buffer);// 将流写入指定文件FileStream fs new FileStream(FileName.dat, FileMode.Create, FileAccess.Write);bool result2 fileSystem.WriteFile(FileName.dat, fs);// 将物理文件写入指定文件bool result3 fileSystem.WriteFile(FileName.dat, E:\PhysicalFileName.dat);} }2-3、实现及代码分析 File System虽说是一个独立的模块但是一般不直接使用通常要配合其他模块比较典型的例子就是资源打包和读取额时候。 因为在做资源更新的时候会将资源进行整理分包加载资源管理器ResourceComponent继承了File System文件系统只需要在构建ResoucrceCollection.xml时在对应的资源Resources标签下指定FileSystem属性即可 Build资源的时候会自动将此Resource放入指定的文件系统运行加载资源时也会自动去对应的FileSystem文件中进行加载。 下面就以打包和加载来分析FileSystem文件系统的代码实现。 2-3-1、打包代码分析 1、点击Start Build Resource按钮后会调用BuildResource函数 /// 资源生成器。 internal sealed class ResourceBuilder : EditorWindowprivate void BuildResources(){if (m_Controller.BuildResources()){Debug.Log(Build resources success.);SaveConfiguration();}else{Debug.LogWarning(Build resources failure.);}} }2、创建文件系统存储在文件系统中 public sealed partial class ResourceBuilderController {public bool BuildResources(){......AssetBundleManifest assetBundleManifest BuildPipeline.BuildAssetBundles(workingPath, assetBundleBuildDatas, buildAssetBundleOptions, GetBuildTarget(platform));......if (OutputPackageSelected){CreateFileSystems(m_ResourceDatas.Values, outputPackagePath, m_OutputPackageFileSystems);}...... }3、创建文件系统后遍历所有的打包资源获取标记了FileSystem标签的项加入文件系统 private void CreateFileSystems(IEnumerableResourceData resourceDatas, string outputPath, Dictionarystring, IFileSystem outputFileSystem) {outputFileSystem.Clear();string[] fileSystemNames GetFileSystemNames(resourceDatas);if (fileSystemNames.Length 0 m_FileSystemManager null){m_FileSystemManager GameFrameworkEntry.GetModuleIFileSystemManager();m_FileSystemManager.SetFileSystemHelper(new FileSystemHelper());}foreach (string fileSystemName in fileSystemNames){int fileCount GetResourceIndexesFromFileSystem(resourceDatas, fileSystemName).Length;string fullPath Utility.Path.GetRegularPath(Path.Combine(outputPath, Utility.Text.Format({0}.{1}, fileSystemName, DefaultExtension)));IFileSystem fileSystem m_FileSystemManager.CreateFileSystem(fullPath, FileSystemAccess.Write, fileCount, fileCount);outputFileSystem.Add(fileSystemName, fileSystem);} }4、写入文件系统把每个经过加密处理的资源写入到指定的文件系统中 public sealed partial class ResourceBuilderController {private bool ProcessOutput(Platform platform, string outputPackagePath, string outputFullPath, string outputPackedPath, bool additionalCompressionSelected, string name, string variant, string fileSystem, ResourceData resourceData, byte[] bytes, int length, int hashCode, int compressedLength, int compressedHashCode){string fullNameWithExtension Utility.Text.Format({0}.{1}, GetResourceFullName(name, variant), GetExtension(resourceData));if (OutputPackageSelected){if (!string.IsNullOrEmpty(fileSystem)){if (!m_OutputPackageFileSystems[fileSystem].WriteFile(fullNameWithExtension, bytes)){return false;}}}} }2-3-2、加载代码分析 1、使用ResourceManager加载资源 internal class ResourceManager : GameFrameworkModule, IResourceManager {/// 异步加载资源。public void LoadAsset(string assetName, Type assetType, int priority, LoadAssetCallbacks loadAssetCallbacks, object userData){m_ResourceLoader.LoadAsset(assetName, assetType, priority, loadAssetCallbacks, userData);} }2、使用Resource任务池加载使用多个LoadResourceAgent代理异步加载资源每个资源加载都是一个LoadAssetTask每个任务开始时都会分配一个LoadResourceAgent代理 internal sealed class TaskPoolT where T : TaskBase {public void Update(float elapseSeconds, float realElapseSeconds){ProcessRunningTasks(elapseSeconds, realElapseSeconds);ProcessWaitingTasks(elapseSeconds, realElapseSeconds);}//处理任务池等待列表private void ProcessWaitingTasks(float elapseSeconds, float realElapseSeconds){LinkedListNodeT current m_WaitingTasks.First;while (current ! null FreeAgentCount 0){ITaskAgentT agent m_FreeAgents.Pop();LinkedListNodeITaskAgentT agentNode m_WorkingAgents.AddLast(agent);T task current.Value;LinkedListNodeT next current.Next;//LoadResourceAgent代理开始读取资源StartTaskStatus status agent.Start(task);current next;...}} }3、资源文件的读取使用了资源加载代理辅助器分别为LoadFromFile、LoadFromMemory两种不同的加载方式 /// 默认加载资源代理辅助器。 public class DefaultLoadResourceAgentHelper : LoadResourceAgentHelperBase, IDisposable {/// 通过加载资源代理辅助器开始异步读取资源文件。public override void ReadFile(string fullPath){m_FileAssetBundleCreateRequest AssetBundle.LoadFromFileAsync(fullPath);}/// 通过加载资源代理辅助器开始异步读取资源文件。public override void ReadFile(IFileSystem fileSystem, string name){FileInfo fileInfo fileSystem.GetFileInfo(name);m_FileAssetBundleCreateRequest AssetBundle.LoadFromFileAsync(fileSystem.FullPath, 0u, (ulong)fileInfo.Offset);}/// 通过加载资源代理辅助器开始异步读取资源二进制流。public override void ReadBytes(string fullPath){m_UnityWebRequest UnityWebRequest.Get(Utility.Path.GetRemotePath(fullPath));m_UnityWebRequest.SendWebRequest();}/// 通过加载资源代理辅助器开始异步读取资源二进制流。public override void ReadBytes(IFileSystem fileSystem, string name){byte[] bytes fileSystem.ReadFile(name);m_LoadResourceAgentHelperReadBytesCompleteEventHandler(this, LoadResourceAgentHelperReadBytesCompleteEventArgs.Create(bytes));} }4、最后通过LoadMain从Bundle中读取资源最后运行监听事件LoadComplete加载全部完成 /// 默认加载资源代理辅助器。 public class DefaultLoadResourceAgentHelper : LoadResourceAgentHelperBase, IDisposable {/// 通过加载资源代理辅助器开始异步读取资源文件。public override void ReadFile(string fullPath){m_FileAssetBundleCreateRequest AssetBundle.LoadFromFileAsync(fullPath);}/// 通过加载资源代理辅助器开始异步读取资源文件。public override void ReadFile(IFileSystem fileSystem, string name){FileInfo fileInfo fileSystem.GetFileInfo(name);m_FileAssetBundleCreateRequest AssetBundle.LoadFromFileAsync(fileSystem.FullPath, 0u, (ulong)fileInfo.Offset);}/// 通过加载资源代理辅助器开始异步读取资源二进制流。public override void ReadBytes(string fullPath){m_UnityWebRequest UnityWebRequest.Get(Utility.Path.GetRemotePath(fullPath));m_UnityWebRequest.SendWebRequest();}/// 通过加载资源代理辅助器开始异步读取资源二进制流。public override void ReadBytes(IFileSystem fileSystem, string name){byte[] bytes fileSystem.ReadFile(name);m_LoadResourceAgentHelperReadBytesCompleteEventHandler(this, LoadResourceAgentHelperReadBytesCompleteEventArgs.Create(bytes));} }三、后记 如果觉得本篇文章有用别忘了点个关注关注不迷路持续分享更多Unity干货文章。 你的点赞就是对博主的支持有问题记得留言 博主主页有联系方式。 博主还有跟多宝藏文章等待你的发掘哦 专栏方向简介Unity3D开发小游戏小游戏开发教程分享一些使用Unity3D引擎开发的小游戏分享一些制作小游戏的教程。Unity3D从入门到进阶入门从自学Unity中获取灵感总结从零开始学习Unity的路线有C#和Unity的知识。Unity3D之UGUIUGUIUnity的UI系统UGUI全解析从UGUI的基础控件开始讲起然后将UGUI的原理UGUI的使用全面教学。Unity3D之读取数据文件读取使用Unity3D读取txt文档、json文档、xml文档、csv文档、Excel文档。Unity3D之数据集合数据集合数组集合数组、List、字典、堆栈、链表等数据集合知识分享。Unity3D之VR/AR虚拟仿真开发虚拟仿真总结博主工作常见的虚拟仿真需求进行案例讲解。Unity3D之插件插件主要分享在Unity开发中用到的一些插件使用方法插件介绍等Unity3D之日常开发日常记录主要是博主日常开发中用到的用到的方法技巧开发思路代码分享等Unity3D之日常BUG日常记录记录在使用Unity3D编辑器开发项目过程中遇到的BUG和坑让后来人可以有些参考。
http://www.zqtcl.cn/news/611304/

相关文章:

  • 湖州房产网站建设南通市城乡和住房建设局网站
  • 郴州建设工程集团招聘信息网站wordpress 橘子皮模板
  • win7搭建网站服务器成都网站建设需多少钱
  • 网站开发一般需要多久菜谱网站模版
  • 基于jsp的电子商务网站开发最好的网站建设公司哪家好
  • 个人网站图片郑州技术支持seo
  • 先做网站还是先做app广州互联网
  • 租用网站的服务器wordpress手机加搜索
  • 做彩票网站怎么样才能让百度收录自己的网站
  • 廊坊网站建设技术托管seo怎么优化关键词排名培训
  • 抛丸机网站怎么做手机网站打不开的解决方法
  • 上海做网站的公司多少钱冷水江网站
  • 百度网站流量查询宣传片制作公司费用
  • 安徽炒股配资网站开发搭建平台载体
  • 中华建设杂志网站记者黑龙江省建设集团有限公司网站首页
  • 成都络迈品牌网站建设网站建设的行业资讯、
  • 英语网站大全免费赤峰市建设厅官方网站
  • 宁波网站建设熊掌号成都网络关键词排名
  • 织梦网站改版需要怎么做平台设计软件
  • 企业展示型网站网站建设设计
  • 增城网站建设服务网站建设制作设计公司佛山
  • 微网站套餐自媒体网站源码模板dede
  • 企业网站改版升级成都便宜网站建设公司
  • 广州公共资源建设工程交易中心网站新塘做网站
  • 数码港 太原网站开发公司iis 建立子网站
  • 做一个自己的网站需要什么商标设计网站猪八戒
  • 傻瓜式网站建设软件保险预约
  • 网站 备案规定自己做简单网站
  • 网站上怎么做支付接口南乐网站建设
  • 咸阳网站建设公司电话做个公司网站大概多少钱