1.Editor(只要叫这个名字的文件夹,可以存在多个)
叫这名字的文件夹下所有资源文件和脚本文件都不会被打到包中。脚本也只有编辑时候能用。编辑器相关的资源可以放入此文件中;
2.Editor Default Resources(Assets下根目录)
不会打包到包中。里边放资源配合Editor文件夹下的脚本使用
ex:TextAsset text = EditorGUIUtility.Load("test.txt")as TextAsset;
3.Gizmos(Assets下根目录)
this.transform.position地方绘制一个图片0.png
void OnDrawGizmos() {
Gizmos.DrawIcon(this.transform.position, "0.png", true);
}
OnDrawGizmos继承自MonoBehaviour的脚本在编辑模式下就有执行,发布后不会执行。绘制轨迹会用到,比如运动轨迹。。。
4.Plugins(Assets下根目录)
放SDK,及其他插件等
5.Resources(只要叫这个名字的文件夹,可以存在多个,会压缩资源 只读)
叫这名字的文件夹下所有资源都会被打包
代码访问:Resources.Load("")
6.StreamingAssets(Assets下根目录,不会压缩资源 只读)
代码访问:Application.streamingAssetsPath 或者下边
#if UNITY_EDITOR
string filepath = Application.dataPath +"/StreamingAssets"+"/filename";
#elif UNITY_IPHONE
string filepath = Application.dataPath +"/Raw"+"/filename";
#elif UNITY_ANDROID
string filepath = "jar:file://" + Application.dataPath + "!/assets/"+"/filename;
#endif
7.应用安装后才会创建可读可写的目录
代码访问:Application.persistentDataPath
可读可写,可拿来热更新用;