当前位置:网站首页>[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 .
边栏推荐
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
- Login operation (for user name and password)
- (August 9, 2021) example exercise of air quality index calculation (I)
- CSDN documentation specification
- Anti clockwise rotation method of event arrangement -- PHP implementation
- Common built-in modules
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15
- Ternsort model integration summary
- Hongke case study on storm impact in coastal areas of North Carolina using lidar
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
猜你喜欢
Simple understanding of seesion, cookies, tokens
Entitas learning [3] multi context system
CSDN documentation specification
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21
QQ group administrators
2021-08-09
Leetcode: 408 sliding window median
(2021-08-20) web crawler learning 2
Entitas learning [iv] other common knowledge points
SAP ui5 date type sap ui. model. type. Analysis of the display format of date
随机推荐
Attributes and methods in math library
nn. Exploration and experiment of batchnorm2d principle
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14
2021-10-20
Some summaries of the 21st postgraduate entrance examination 823 of network security major of Shanghai Jiaotong University and ideas on how to prepare for the 22nd postgraduate entrance examination pr
Lecture 9
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
Properties and methods of OS Library
CSDN documentation specification
Btrace tells you how to debug online without restarting the JVM
Iptables cause heartbeat brain fissure
Classification and application of AI chips
Entitas learning [3] multi context system
Login operation (for user name and password)
[solve the error of this pointing in the applet] SetData of undefined
Install freeradius3 in the latest version of openwrt
OSI model notes
About the use of URL, href, SRC attributes
The detailed installation process of Ninja security penetration system (Ninjitsu OS V3). Both old and new VM versions can be installed through personal testing, with download sources