![]() ![]() On the other hand using references that are exposed in the inspector are self-documenting and immediately obvious to the user of your script. When you place assets in "Resources" folders this can not be done, thus all assets in the "Resources" folders will be included in a build.Īnother disadvantage of using path names is that it leads to less reusable code since scripts will have specific hard coded requirements on where the used assets are placed. This radically minimizes the size of your players to the assets that you actually use in the built game. When using this technique Unity can automatically calculate which assets are used when building a player. ![]() In Unity you usually don't use path names to access assets, instead you expose a reference to anĪsset by declaring a member-variable, and then assign it in the inspector. Multiple "Resources" folders may exist and when loading objects each will be examined. In the editor, Resources.FindObjectsOfTypeAll can be used to locate assets and Scene objects.Īll assets that are in a folder named "Resources" anywhere in the Assets folder can be accessed via the Resources.Load functions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |