- Home /
How to use Resources in custom EditorWindow?
I want to make a bit of a stylish custom editor window so I need to be able to use Textures and GUISkins. What is the preferred way of making use of Textures and GUISkins? I assume there are two ways of going about.
- Use Default References.
- Use Resources.Load.
- Are there other approaches?
- What approach is preferred?
- Does using Resources.Load mean that those resources would be included in any build?
Answer by Bunny83 · Mar 28, 2011 at 10:51 PM
Sure, if you place them in the Resources
folder it will be included in your builds.
Inside the editor you can use the AssetDatabase to load an asset at any time. You can even use WWW with "file:///" to load a texture for your editor scripts. WWW is restricted to the supported types of course (audio, movie, texture, assetBundles and the raw data).
So i guess for a GUISkin it would be the best to place it inside the editor folder and use the AssetDatabase.
Not sure if assetBundles will work in the editor, I haven't worked with them yet.