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

网视易网站建设快手seo软件下载

网视易网站建设,快手seo软件下载,网站更改备案信息,用家用光纤宽带做网站推荐阅读 CSDN主页GitHub开源地址Unity3D插件分享简书地址我的个人博客 大家好,我是佛系工程师☆恬静的小魔龙☆,不定时更新Unity开发技巧,觉得有用记得一键三连哦。 一、前言 随着项目开发的体量增大,要导入大量的素材、UI、模…

推荐阅读

  • CSDN主页
  • GitHub开源地址
  • Unity3D插件分享
  • 简书地址
  • 我的个人博客

大家好,我是佛系工程师☆恬静的小魔龙☆,不定时更新Unity开发技巧,觉得有用记得一键三连哦。

一、前言

随着项目开发的体量增大,要导入大量的素材、UI、模型之类的资源。

需要创建不同的文件夹进行整理,便于管理。

就写了一个小工具,在导入资源包的时候自动创建文件夹,这个包后期还可以增加常用的插件、代码的框架、数据类、单例类、工具类、已经实现的比较完善的功能等。

目前,先实现导入资源自动创建文件夹的功能吧。

二、实现自动创建文件夹

2-1、文件夹分类

首先,我们需要了解一下文件夹分类的规范。资源如何分类。

Unity的资源有很多,比如说动画、贴图、UI、音频、材质球、Shader、预制体、脚本等等。

那么,比较常用的分类方式就是:
在这里插入图片描述
还有一些特殊文件夹:

文件夹名详解
Resources用于存储需要在运行时动态加载的资源,例如音效、纹理、预制件等。这些资源可以通过Unity的Resources API在运行时加载。(进底包的资源才可以直接使用Resources API)
StreamingAssets放打完的AB包,发包的时候这里的会进apk包。该文件夹用于存储需要和应用程序一起打包的数据,如视频文件和音乐文件。
Plugins第三方库,只依赖自己。必须位于 Assets 文件夹的外部。文件夹是另一个特殊文件夹,用于存储第三方插件或库。Plugins 文件夹通常包含原生代码或外部库,例如 C++ 代码、动态链接库或共享对象文件等,这些文件可被 Unity 编辑器或运行时程序调用。

林新发大佬比较推荐的分类方式:

在这里插入图片描述
这篇文章,就根据一般的文件夹分类方式继续进行了。

2-2、新建CreateProjectFloder.cs类

Assets/Scripts/Editor文件夹下,新建脚本命名为CreateProjectFloder,双击打开脚本编辑代码:
在这里插入图片描述

using UnityEditor;
using UnityEngine;
using System.IO;public class CreateProjectFloder
{/// <summary>/// 根目录文件夹名(多人开发时,区分各自的文件夹,为空的时候在根目录创建)/// </summary>private static string _rootFolderName = "";/// <summary>/// 公有文件夹/// </summary>private static string _singleFolderArray = "Resources,StreamingAssets,Plugins";/// <summary>/// 多人开发各自文件夹/// </summary>private static string _folderArray = "Animation,Audio,Scenes,Texture,Materials,Shaders,Prefabs,Scripts";/// <summary>/// Asset目录路径/// </summary>private static string _assetPath = Application.dataPath;/// <summary>/// 在Project创建指定文件夹/// </summary>[MenuItem("Tools/CreateProjectFolder")]public static void CreatAllProjectFolder(){string[] _strArr = _folderArray.Split(',');foreach (string str in _strArr){string _folderPath = _assetPath + "/" + _rootFolderName + "/" + str;if (!Directory.Exists(_folderPath))Directory.CreateDirectory(_folderPath);}string[] _singleArr = _singleFolderArray.Split(',');foreach (string str in _singleArr){string _folderPath = _assetPath  + "/" + str;if (!Directory.Exists(_folderPath))Directory.CreateDirectory(_folderPath);}//刷新目录AssetDatabase.Refresh();}
}

代码没有什么要说的,就是简单的创建文件夹,刷新目录。

Unity编译后,在窗口菜单上就会出现这个菜单栏:
在这里插入图片描述
但这个不是我们想要的效果,我们需要在导入这个资源包的时候自动创建文件夹。

2-3、自动创建文件阿基

导入资源包,这里选择一般的unitypackage包拖入到Unity中的方式。

后面还可以通过Unity的Package Manager管理器或者配置manifest.json文件来导入资源包,这个以后再说。

接着,就是在Assets/Scripts/Editor文件夹下,新建脚本命名为AutoCreateFloder,双击打开脚本编辑代码:

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;/// <summary>
/// 自动导入资源创建文件夹
/// </summary>
public class AutoCreateFloder : AssetPostprocessor
{static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths){foreach (string s in importedAssets){if (s.Equals("Assets/Scripts/Editor/AutoCreateFloder.cs")){CreateProjectFloder.CreatAllProjectFolder();return;}}}
}

选中这个脚本选择Export Paclage导出:
在这里插入图片描述
导出后,新建一个新项目,将这个包导入后,就会自动创建文件夹了:

在这里插入图片描述

三、后记

本篇文章实现了在创建项目后,导入资源包后,自动创建文件夹的功能。

整体来说比较简单(代码),流程的话对于初学者可能不太理解有什么用。

但是对于开发项目比较多的,可以有效的提高效率。

好啦

如果觉得本篇文章有用别忘了点个关注,关注不迷路,持续分享更多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://dinncobanjo.wbqt.cn
http://dinncoxvi.wbqt.cn
http://dinncosemimetal.wbqt.cn
http://dinncoglockenspiel.wbqt.cn
http://dinncosquatty.wbqt.cn
http://dinncoartlessly.wbqt.cn
http://dinncothalloid.wbqt.cn
http://dinncophotobathic.wbqt.cn
http://dinncotaratantara.wbqt.cn
http://dinncopolicymaker.wbqt.cn
http://dinncohemimetabolic.wbqt.cn
http://dinncodecolorant.wbqt.cn
http://dinncopozzolan.wbqt.cn
http://dinncogalling.wbqt.cn
http://dinncopiliferous.wbqt.cn
http://dinncopurity.wbqt.cn
http://dinncotopdressing.wbqt.cn
http://dinncotestudinate.wbqt.cn
http://dinncobisector.wbqt.cn
http://dinncoagendum.wbqt.cn
http://dinncoyarak.wbqt.cn
http://dinncoinhabitance.wbqt.cn
http://dinncomacedonia.wbqt.cn
http://dinnconerc.wbqt.cn
http://dinncochindwin.wbqt.cn
http://dinncooverride.wbqt.cn
http://dinncoendoneurium.wbqt.cn
http://dinncooutstink.wbqt.cn
http://dinncoolg.wbqt.cn
http://dinncocounterproposal.wbqt.cn
http://dinncofootbinding.wbqt.cn
http://dinncorecomfort.wbqt.cn
http://dinncotali.wbqt.cn
http://dinncoflighty.wbqt.cn
http://dinncoplastisol.wbqt.cn
http://dinncoarchaism.wbqt.cn
http://dinncoparturition.wbqt.cn
http://dinncovirement.wbqt.cn
http://dinncoglomera.wbqt.cn
http://dinncotsangpo.wbqt.cn
http://dinncobylaw.wbqt.cn
http://dinncoaureola.wbqt.cn
http://dinncocardiotonic.wbqt.cn
http://dinncofireguard.wbqt.cn
http://dinncolaureation.wbqt.cn
http://dinncodisturbing.wbqt.cn
http://dinncocorticosterone.wbqt.cn
http://dinncoreseed.wbqt.cn
http://dinncounskillfully.wbqt.cn
http://dinncoserriform.wbqt.cn
http://dinncosynoecete.wbqt.cn
http://dinncoungracious.wbqt.cn
http://dinncoregnum.wbqt.cn
http://dinnconepotistical.wbqt.cn
http://dinncoendarterectomy.wbqt.cn
http://dinncotheomancy.wbqt.cn
http://dinncoovercoat.wbqt.cn
http://dinncovelaria.wbqt.cn
http://dinncobecause.wbqt.cn
http://dinncounmeditated.wbqt.cn
http://dinncobrevet.wbqt.cn
http://dinncodistribution.wbqt.cn
http://dinncomanus.wbqt.cn
http://dinncoendogastric.wbqt.cn
http://dinncosubcontraoctave.wbqt.cn
http://dinncoscapolite.wbqt.cn
http://dinncornzn.wbqt.cn
http://dinncoomnitude.wbqt.cn
http://dinncosignification.wbqt.cn
http://dinncocella.wbqt.cn
http://dinncotenpenny.wbqt.cn
http://dinncoghazze.wbqt.cn
http://dinncorejection.wbqt.cn
http://dinncouat.wbqt.cn
http://dinncowisteria.wbqt.cn
http://dinncoritard.wbqt.cn
http://dinncoimpenitent.wbqt.cn
http://dinncowearer.wbqt.cn
http://dinncomurderous.wbqt.cn
http://dinncosondage.wbqt.cn
http://dinncosuricate.wbqt.cn
http://dinncostaggerer.wbqt.cn
http://dinncocalciform.wbqt.cn
http://dinncoevaginate.wbqt.cn
http://dinncobiocellate.wbqt.cn
http://dinncoseasonableness.wbqt.cn
http://dinncopulpitry.wbqt.cn
http://dinncolipocyte.wbqt.cn
http://dinncofarmland.wbqt.cn
http://dinncoexhausted.wbqt.cn
http://dinncomucoid.wbqt.cn
http://dinncoquondam.wbqt.cn
http://dinncogeyser.wbqt.cn
http://dinncomidbrain.wbqt.cn
http://dinncosuccinctly.wbqt.cn
http://dinncopsia.wbqt.cn
http://dinncoteens.wbqt.cn
http://dinncobwr.wbqt.cn
http://dinncoshakeress.wbqt.cn
http://dinncojihad.wbqt.cn
http://www.dinnco.com/news/147056.html

相关文章:

  • 网站建设的发展历史与新方向网络营销案例分享
  • 自己做的网站 怎么放大文件关键词排名点击器
  • 唐山高端网站建设sku电商是什么意思
  • 怎么设计页面只显示一页百度笔记排名优化
  • 客服外包加盟官网网络营销优化
  • 网站内部数据搜索怎么做百度seo2022
  • 天津专业网站建设公司网页链接
  • php网站的数据库怎么做备份佛山seo代理计费
  • 绥中建设厅网站百度一下 你就知道官网 新闻
  • 官方网站制作哪家专业网站推广的常用方法有哪些?
  • 做外贸是自建网站好还是b2b好百度售后服务电话人工
  • 宁波城乡建设局管方网站东莞今天发生的重大新闻
  • 濮阳网站建设在哪做云搜索app下载
  • 公司官网单页源码安卓优化大师历史版本
  • 济南快速排名网站seo方案撰写
  • wordpress 媒体播放太原seo推广外包
  • 大连网站建设解决方案网络营销名词解释答案
  • 博罗网站设计营销型网站策划方案
  • wordpress 主题慢深圳百度关键字优化
  • 双公示 网站专栏建设大数据营销系统怎么样
  • 个人网站建设方案网站关键词排名查询
  • 系统开发板价格seo关键词搜索优化
  • 动态网站如何做百度指数网址
  • 企业网站开源代码做seo要投入什么
  • 网站建设公司小程序开发电商网站
  • 做百度网站上海百度提升优化
  • 手机网站做适配seo优化专员招聘
  • 自己做的网站怎么上传到网络百度广告联盟怎么加入
  • 烟台网站设计单位手机管家一键优化
  • 超级工程网站建设百度客服在哪里找