Resources Protocol

From PowerUI
Revision as of 15:40, 13 January 2017 by 151.229.186.156 (talk) (Created page with "resources:// is a great way to refer to any file within a Resources folder in your project. It's the default protocol too. It works with everything that accepts a URI - from X...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

resources:// is a great way to refer to any file within a Resources folder in your project. It's the default protocol too. It works with everything that accepts a URI - from XMLHttpRequest through to CSS background-image. You can have multiple folders called Resources in your project, and any sub-folders do "just work". For example:

Resources/MyImages/logo.png

<img src='resources://MyImages/logo.png'>

File extensions like .css

Unity doesn't recognise 'css' as a textual file when in the project. You'll need to either name it 'myFile.css.bytes' for your 'myFile.css' links to work, or name it something that Unity does recognise as a text file like .txt or .html.