当前位置:网站首页>[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 .
边栏推荐
- Function parameters (positional parameters, default value parameters, variable parameters, named keyword parameters, keyword parameters)
- DDS-YYDS
- QQ get group link, QR code
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
- AI should take code agriculture? Deepmind offers a programming version of "Alpha dog" alphacode that surpasses nearly half of programmers!
- ASP. Net razor – introduction to VB loops and arrays
- Entitas learning [iv] other common knowledge points
- 2021 annual summary - it seems that I have done everything except studying hard
- Ultimate bug finding method - two points
猜你喜欢
OSI seven layer model & unit
Practical dry goods: deploy mini version message queue based on redis6.0
[the way of programmer training] - 2 Perfect number calculation
QQ group collection
Force buckle 142 Circular linked list II
The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
Reptile learning 4 winter vacation series (3)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18
ASP. Net razor – introduction to VB loops and arrays
Detailed explanation of NPM installation and caching mechanism
随机推荐
2021-08-09
Anti clockwise rotation method of event arrangement -- PHP implementation
Lvs+kept highly available cluster
priority_ queue
[ES6] template string: `string`, a new symbol in es2015
A few words explain redis cache penetration, breakdown, avalanche, and redis sentinel
Solaris 10 network services
Video analysis
Reptile learning 4 winter vacation learning series (1)
Definition and method of string
MPLS experiment
Detailed explanation of NPM installation and caching mechanism
QQ get group information
Summary of Shanghai Jiaotong University postgraduate entrance examination module firewall technology
Automatic translation between Chinese and English
C language memory layout
OSI seven layer reference model
os. Path built-in module
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
Openssl3.0 learning 20 provider KDF