在脚本中直接调用Application类的静态属性和静态方法:场景的管理,数据的加载
staitc property | |
dataPath | 数据文件路径 |
persistentdatapath | 返回一个持久化数据存储目录的路径(只读) |
streamingassetspath |
适合设置一些外部数据文件的路径,用于返回流数据的缓存目录(相对路径) |
temporraryCachePath | 此属性用于返回一个临时数据的缓存目录(只读) |
static method | |
capturescreenshot | 截屏 |
dataPath:
返回程序的数据文件所在了文件夹的路径(只读)
UNtiy Editor<工程文件夹所在路径>/Assets
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DataPath_ts : MonoBehaviour
{
private void Start()
{
//四种不同领域(只读
Debug.Log("datapath