当前位置:网站首页>Unity application class and data file path
Unity application class and data file path
2022-06-30 05:02:00 【StudyHard_ luozhongxu】
Application Class static properties and static methods :
Static attribute (Static Variables)
| Static attribute | English explanation | English description |
|---|---|---|
| string dataPath | Contains the path to the game data folder (Read Only). | Game data path |
| string persistentDataPath | Contains the path to a persistent data directory (Read Only). | Persistent data path . |
| string streamingAssetsPath | Contains the path to the StreamingAssets folder (Read Only). | Stream data cache directory . |
| string temporaryCachePath | Contains the path to a temporary data / cache directory (Read Only). | Zero time cache directory . |
| int levelCount | The total number of levels available (Read Only). | Total number of scenarios . |
| int loadedLevel | The level index that was last loaded (Read Only). | Sequence number of the currently loaded scene |
| int loadedLevelName | The name of the level that was last loaded (Read Only). | The name of the currently loaded scene . |
| bool isLoadingLevel | Is some level being loaded? (Read Only). isLoadingLevel returns true if a level load was requested this frame already. | Indicates whether the currently loaded scene still needs the current frame . |
| NetworkReachability internetReachability | Returns the type of Internet reachability currently possible on the device. | Indicates the network connection mode of the current device . |
| RuntimePlatform platform | Returns the platform the game is running (Read Only). | Indicates the platform on which the current game is running . |
| bool isConsolePlatform | Is the current Runtime platform a known console platform. | Indicates whether the currently running platform is a console . |
| bool isMobilePlatform | Is the current Runtime platform a known mobile platform. | Whether the currently running platform is a mobile platform . |
| bool isWebPlayer | Are we running inside a web player? (Read Only). | Whether the currently running platform is web platform . |
| bool isEditor | Are we running inside the Unity editor? (Read Only). | Indicates whether you are currently in Unity Run the program in the editor environment . |
| int targetFrameRate | Instructs game to try to render at a specified frame rate. | Frame rate . |
| ThreadPriority backgroundLoadingPriority | Priority of background loading thread. | Indicates the background load priority . |
| string bundleIdentifier | eturns application bundle identifier at runtime. | Represents the identifier of the application runtime . |
| string cloudProjectId | A unique cloud project identifier. It is unique for every project (Read Only). | Unique identifier of the cloud application . |
| string companyName | Return application company name (Read Only). | Applied company name . |
| ApplicationInstallMode installMode | Returns application install mode (Read Only). | Apply installation mode . |
| bool runInBackground | Should the player be running when the application is in the background? | Whether the application is running in the background . |
| ApplicationSandboxType sandboxType | Returns application running in sandbox (Read Only). | The type of sandbox the application runs . |
| string srcValue | The path to the web player data file relative to the html file (Read Only). | web player Path to file . |
| int streamedBytes | How many bytes have we downloaded from the main unity web stream (Read Only). | Number of byte streams . |
| SystemLanguage systemLanguage | How many bytes have we downloaded from the main unity web stream (Read Only). | Current system language . |
| string unityVersion | The version of the Unity runtime used to play the content. | Unity Version of . |
| string version | Returns application version number (Read Only). | Application version . |
| int webSecurityEnabled | Indicates whether Unity's webplayer security model is enabled. | unity Of webplayer Whether the security mode of is enabled . |
| string absoluteURL | The absolute path to the web player data file (Read Only). | Used to keep in web The absolute path of the data file in the browser . |
| bool genuine | Returns false if application is altered in any way after it was built. | |
| bool genuineCheckAvailable | Contains the path to the game data folder (Read Only). | |
| ApplicationInstallMode installMode | Returns application install mode (Read Only). | Apply installation mode . |
Static methods (Static Functions)
| Static methods | English explanation | English description |
|---|---|---|
| void LoadLevel(int index); void LoadLevel(string name); | Loads the level by its name or index. | Load the scene according to the scene name and index number |
| void LoadLevelAdditive(int index);void LoadLevelAdditive(string name); | Loads a level additively. | Load the scene according to the scene name and index number , But the objects in the current scene are not destroyed |
| AsyncOperation LoadLevelAsync(int index); AsyncOperation LoadLevelAsync(string levelName); | Loads the level asynchronously in the background. | Loading scenarios asynchronously |
| AsyncOperation LoadLevelAdditiveAsync(int index); AsyncOperation LoadLevelAdditiveAsync(string levelName); | Loads the level additively and asynchronously in the background. | Loading scenarios asynchronously , And the current object is not destroyed |
| void Quit(); | Quits the player application. | Quit the game |
| void CancelQuit(); | Cancels quitting the application. This is useful for showing a splash screen at the end of a game. | Cancel application exit . |
| bool CanStreamedLevelBeLoaded(int levelIndex); | Can the streamed level be loaded? | Get the current levelindex Whether the scene is loaded . |
| void CaptureScreenshot(string filename, int superSize = 0); | Captures a screenshot at path filename as a PNG file. | screenshots . |
| void OpenURL(string url); | Opens the url in a browser. | Visit the web address in the browser |
| AsyncOperation RequestUserAuthorization(UserAuthorization mode); | Request authorization to use the webcam or microphone in the Web Player. | Request permission |
| void ExternalCall(string functionName, params object[] args); | alls a function in the containing web page (Web Player only). | stay webplayer A call to a javaScrip function . |
| void ExternalEval(string script); | Evaluates script snippet in the containing web page (Web Player only). | stay webplayer On the implementation javascrip fragment . |
| float GetStreamProgressForLevel(int levelIndex); | How far has the download progressed? [0...1]. | Download progress . |
| bool HasUserAuthorization(UserAuthorization mode); | pCheck if the user has authorized use of the webcam or microphone in the Web Player. | Check whether the user has webcam And mobile phones webpalyer Authority . |
Link to the above table source :http://www.jianshu.com/p/617789c9919a
Data file path , There are four attributes , Respectively :dataPath、persistentDataPath、streamingAssetsPath、 temporaryCachePath.
- dataPaht Is the path to the folder containing game data , Permission is read-only , Back to a Relative paths , That is, the return path is different for different game platforms . Be careful :Application.dataPath The returned path Directory , The mobile terminal has no access rights ( You cannot access this directory ).
- persistentDataPaht What is returned is a persistent data store directory , Permission is read-only , stay The same platform , Unused applications access this property Same return value , But different platforms are different . When an application is published to IOS and Android In the platform , This path will point to a public path , And the data here will not be cleared every time the application is updated .
Be careful : This path is special , This path is readable and writable . And in IOS This is the sandbox of the application , But in Android It can be the sandbox of the program , It can also be SDCard. And in Android When it comes to packaging and Publishing ,PlayerSetting Set in the Write Access Options , The path of sandbox can be set SDCard, By default Internal Only Sandbox . The characteristics of this path :
- The content is readable and writable , However, it can only be written or read at runtime . It is not feasible to store data in this path in advance .
- No content restrictions . You can start your StreamingAsset Read binaries from or from AssetBundle Read the file to write PersistentDataPath in .
- Written documents , You can view it on your computer . It can also be removed .
- streamingAssetsPath What is returned is the cache directory of the stream data , The return path is a relative path, which is suitable for storing some external data files .
- temporaryCachePath Return a temporary data cache directory ( read-only ), The return value of this property accessed by the same platform without application is the same , Different platforms have different return values .summary :dataPath and stremingAssetsPath Is relative to the installation directory of the program , Is a relative path . It is very suitable for the migration platform to set the external data file reading path . and persistentDataPath and temporaryCachePath The fixed position of the platform where the returned program is located . It is applicable to the storage of some data during the operation of the program .
Source link :http://www.jianshu.com/p/bbc2690bce30
边栏推荐
- Force buckle 977 Square of ordered array
- Webots notes day 2
- 力扣周赛293题解
- Unrealeengine4 - about uobject's giant pit that is automatically GC garbage collected
- Win10 vs2015 compiling curaengine
- redis集群概念
- Force buckle 209 Minimum length subarray
- Unreal 4 unavigationsystemv1 compilation error
- Spring Festival Tourism Strategy: welcome the new year in Bangkok, Thailand
- 0 basic unity course. Bricklaying
猜你喜欢

Qos(Quality of Service)

【Paper】2021_ Uniformity of heterogeneous hybrid multi-level intelligent systems using UGV and UAV

Malignant bug: 1252 of unit MySQL export

Some books you should not miss when you are new to the workplace

A virtual reality secret room escape adventure, let you see Technology Singapore

Royal Albert Hall, a popular landmark in London

力扣27. 移除元素

pycharm 数据库工具

PBR material: basic principle and simple fabrication

On mask culling of unity
随机推荐
Recommended cultural landmarks of these tourist attractions in Bangkok
2021-03-16
力扣209. 长度最小的子数组
Detailed explanation of sorting sort method of JS array
Pourquoi l'ordinateur n'a - t - il pas de réseau après l'ouverture du Hotspot win10?
UnityEngine. JsonUtility. The pit of fromjason()
Procedural animation -- inverse kinematics of tentacles
Free travel recommendation in Bangkok: introduction to the Mekong River in Bangkok
Have a heart beating Valentine's day in Singapore
Exploration of unity webgl
Nestjs入门和环境搭建
Introduction to some representations, neighbors and degrees of Graphs
Deeply understand the function calling process of C language
z-index属性在什么情况下会失效?
Draw on screen border in Commodore 64
Spring Festival Tourism Strategy: welcome the new year in Bangkok, Thailand
How to install win7 on AMD Ruilong CPU A320 series motherboard
【Paper】2021_ Uniformity of heterogeneous hybrid multi-level intelligent systems using UGV and UAV
The difference between SVG and canvas
Circle center technology, very anxious?