当前位置:网站首页>[notes] streamingassets
[notes] streamingassets
2022-07-04 12:23:00 【Porridge cook_ ninety-nine】
Streaming resources - Unity manual Unity Integrate most resources into the project when building the project . however , It is sometimes useful to put files into a normal file system on the target computer so that they can be accessed by pathname . An example of this is in iOS Deploy movie files on the device ; The original movie file must be located somewhere in the file system so that it can be accessed by PlayMovie Function to play .https://docs.unity3d.com/cn/2020.3/Manual/StreamingAssets.htmlUnity stay build Project When will most Assets Merge into Project in . however , Put the file into the normal file system on the target computer —— Make them accessible by pathname , Sometimes it is very useful .( such as , stay iOS Deploy movie files on the device , The original movie file must be located somewhere in the file system , Only by PlayMovie
Function to play .)
Unity Will Project Middle name is StreamingAssets( Case sensitive ) All files in the folder of are copied verbatim to a specific folder on the target computer . To get this folder , Use Application.streamingAssetsPath attribute . No matter when , To get StreamingAssets The best way to locate folders is to use Application.streamingAssetsPath
, Because it always points to the correct location on the platform where the application is running .
Application.streamingAssetsPath
The location of the return varies depending on the platform :
Most platforms (Unity Editor 、Windows、Linux player 、PS4、Xbox One、Switch) | Application.dataPath + "/StreamingAssets" |
macOS player | Application.dataPath + "/Resources/Data/StreamingAssets" |
iOS | Application.dataPath + "/Raw" |
Android | Use compressed APK/JAR Documents in documents : "jar:file://" + Application.dataPath + "!/assets" |
On platforms that cannot directly access streaming media resource files ( Such as Android and WebGL) Read streaming media resources on , Please use UnityWebRequest. For example , see also Application.streamingAssetsPath.
On many platforms ,StreamingAssets The folder location is read-only Of ; You cannot modify or write new files in these locations at runtime . Please use Application.persistentDataPath To get the writable folder location .
Be careful : be located StreamingAssets In folder .dll And script files do not participate in Script Compilation .
It can also be done through Resource Pack (Asset Bundle) or Addressable resources (Addressable) To access content that is not part of conventional game construction data , in many instances , These access methods are better than Streaming Assets Folder .
边栏推荐
- Star leap plan | new projects are continuously being recruited! MSR Asia MSR Redmond joint research program invites you to apply!
- 03_ Armv8 instruction set introduction load and store instructions
- 2021-08-09
- PKCs 5: password based cryptography specification version 2.1 Chinese Translation
- Automatic translation between Chinese and English
- OSI seven layer model & unit
- How to use the mongodb ID array to get multiple documents- How to get multiple document using array of MongoDb id?
- ASP. Net razor – introduction to VB loops and arrays
- How do std:: function and function pointer assign values to each other
- priority_ queue
猜你喜欢
ASP. Net razor – introduction to VB loops and arrays
Reptile learning 4 winter vacation series (3)
CSDN documentation specification
Entitas learning [3] multi context system
Application of slice
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
Memory computing integration: AI chip architecture in the post Moorish Era
The latest idea activation cracking tutorial, idea permanent activation code, the strongest in history
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
Simple understanding of seesion, cookies, tokens
随机推荐
QQ set group information
Properties and methods of OS Library
Enter the smart Park, and change begins here
C language compilation process
Star leap plan | new projects are continuously being recruited! MSR Asia MSR Redmond joint research program invites you to apply!
[Android reverse] function interception instance (③ refresh CPU cache | ④ process interception function | ⑤ return specific results)
Alibaba cloud server connection intranet operation
Pat 1059 prime factors (25 points) prime table
MPLS experiment
Heartbeat error attempted replay attack
(August 9, 2021) example exercise of air quality index calculation (I)
QQ group collection
Definition and method of string
OSI seven layer reference model
Here, the DDS tutorial you want | first experience of fastdds - source code compilation & Installation & Testing
LxC shared directory permission configuration
Iptables cause heartbeat brain fissure
Reptile learning 4 winter vacation series (3)
Data communication and network: ch13 Ethernet
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17