Unity获取指定资源目录下的所有文件
使用前需要引入System.IO;这个命名空间
public void GetFiles()
{
//路径
//string path = string.Format("{0}", Application.streamingAssetsPath);
string path = string.Format("{0}", @"D:\SHU170221U3D-09\Lesson14\Assets\StreamingAssets"); //获取指定路径下面的所有资源文件
if (Directory.Exists(path))
{
DirectoryInfo direction = new DirectoryInfo(path);
FileInfo[] files = direction.GetFiles("*", SearchOption.AllDirectories); Debug.Log(files.Length); for (int i = ; i < files.Length; i++)
{
if (files[i].Name.EndsWith(".meta"))
{
continue;
}
Debug.Log("Name:" + files[i].Name);
Debug.Log("FullName:" + files[i].FullName);
Debug.Log("DirectoryName:" + files[i].DirectoryName);
}
}
}
Unity获取指定资源目录下的所有文件的更多相关文章
- Unity 获取指定资源目录下的所有文件
string path="Assets";//Assets/Scenes if(Directory.Exists(path)){ var dirctory=new Director ...
- java获取ubuntu某个目录下的所有文件信息
java获取ubuntu某个目录下的所有文件信息 public List<VCFile> getAllFiles(String basicDirName) { List<VCFile ...
- idea 获取resources资源目录下文件
以下格式都是正确的(注意:.properties文件中的第一行不要有空格!): URL resource01 = MainMobile.class.getResource(""); ...
- c# 获取指定目录下的所有文件并显示在网页上
参考文献: FileInfo 的使用 https://msdn.microsoft.com/zh-cn/library/system.io.fileinfo_methods(v=vs.110).as ...
- php获取指定目录下的所有文件列表
在我们实际的开发需求中,经常用到操作文件,今天就讲一下关于获取指定目录下的所有文件的几种常用方法: 1.scandir()函数 scandir() 函数返回指定目录中的文件和目录的数组. scandi ...
- C++:获取指定目录下的所有文件
1.获得指定目录下的所有文件(不搜索子文件夹) 需要包含的头文件 #include <io.h> #include <string> #include <vector&g ...
- 利用 FilesystemIterator 获取指定目录下的所有文件
/** * 获取指定目录下的所有文件 * @param null $path * @return array */ public function getFileByPath($path = null ...
- File常用的方法操作、在磁盘上创建File、获取指定目录下的所有文件、File文件的重命名、将数据写入File文件
文章目录 1.基本介绍 2.构造方法 3.常用的方法 4.代码实例 4.1 创建文件和目录(目录不存在) 4.1.1 代码 4.1.2 测试结果 4.2 测试目录存在的情况.直接写绝对的路径名 4.2 ...
- Qt5读取系统环境变量和获取指定目录下的所有文件夹绝对路径
头文件 /// 读取环境变量使用 #include <QProcessEnvironment> /// 遍历文件夹使用 #include <QDir> 核心代码 一个例子, 输 ...
随机推荐
- Python 訪问Google+ (http)
CODE: #!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-8-28 @author: guaguastd @name: l ...
- cocos2d-x -- removeChild
Test5::Test5() { CCSprite* sp1 = CCSprite::create(s_pPathSister1); CCSprite* sp2 = CCSprite::create( ...
- ny214 单调递增子序列(二) 动态规划
单调递增子序列(二) 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 给定一整型数列{a1,a2...,an}(0<n<=100000),找出单调递增最长子序 ...
- LeetCode: Substring with Concatenation of All Words 解题报告
Substring with Concatenation of All Words You are given a string, S, and a list of words, L, that ar ...
- openldap 备份与导入 及相关问题
摘要: 对openldap进行备份时,直接使用slapcat命令进行备份,使用ldapadd还原出现问题及解决. 介绍: 对openldap进行备份时,直接使用slapcat命令进行备份(如代码一), ...
- Android—— TextView文字链接4中方法
转自:http://ghostfromheaven.iteye.com/blog/752181 Android 的实现TextView中文字链接的方式有很多种. 总结起来大概有4种: 1.当文字中出现 ...
- kernel printk信息显示级别
涉及文件:kernel/printk.c include/linux/kernel.h用printk内核会根据日志级别把消息打印到当前控制台上.信息正常输出前提是--日志输出级别(msg_log_le ...
- 缓存之 ACache
1.android缓存的介绍 Android开发本质上就是手机和互联网中的webserver之间进行通信,就必定须要从服务端获取数据.而重复通过网络获取数据是比較耗时的.特别是訪问比較多的时候.会极大 ...
- 在Ubuntu中安装PHP,MySQL,Nginx和phpMyAdmin
apt install php apt-get install php7.0 apt-get -y install php7.0-fpm 缺少 mysqli 扩展.请检查 PHP 配置. apt in ...
- 腾讯RTX二次开发相关的一些注意事项
http://www.cnblogs.com/netWild/p/4241650.html —————————————————————————————————————————————————————— ...