FileUtil.GetUniqueTempPathInProject 在项目获取唯一临时路径

static function GetUniqueTempPathInProject () : string

Description描述

Returns a unique path in the Temp folder within your current project.

返回一个在当前项目中的临时目录的唯一路径。

The returned path is relative to the project folder.

返回的路径是相对与当前目录的。

The returned path is of a form Temp/UnityTempFile-uniqueID, where uniqueID is guaranteed to be unique over space and time.

返回路径的格式是这样的 Temp/UnityTempFile-uniqueID ,uniqueID 保证了在时间跟空间上的唯一性。

You can use it to create temporary files/folders and be sure that you are not overriding somebody else's files, plus you don't have to keep track of the unique IDs yourself.

你可以说使用它创建临时文件或文件夹,并确保你没有覆盖其他的文件,(下一句翻译不准)?

@MenuItem ("Example/Get Unique Path")
static function GetUniqueProjectPath () {
	// Prints the unique path
	//打印唯一路径
	Debug.Log (FileUtil.GetUniqueTempPathInProject ());
}
Page last updated: 2011-5-7