Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by S_Rank_Crazy · Feb 01, 2014 at 04:16 AM · materialstextures

Do textures for materials need to be in Resources folder also?

So I've been trying to reduce the build size of my project by removing files from the Assets/Resources folder, and i was wondering if the texture (image) files for the materials I've used on my models are required to be in the Resources folder in order for the material to work properly.

Bearing in mind I'm just moving the file, not deleting it entirely. Have noticed some oddities sometimes with Unity when I move a file from one place to another.

Any help, or point in the right direction, would be a great help. Thanks :)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by supernat · Feb 01, 2014 at 04:27 AM

The Resources folder is primarily for adding assets that you want to load dynamically at runtime. You definitely don't want to store anything in there that isn't used at runtime. When you call things like LoadResource("texture"), it looks in the Resources folder. Unity guarantees it will copy the Resources folder to your app. Anything outside of the Resources folder will only be copied if it has a direct reference to a scene in the editor.

Here's a link to the help page: http://docs.unity3d.com/Documentation/ScriptReference/Resources.html

Regarding moving files, if you move them in the Editor, you are safe (for the most part). If you move them in Windows Explorer or Mac Finder, not so much. Also, I noticed that having the meta data enabled for version control leads to less unrecoverable loss of scenes. I think that may be on by default now days though.

To address your specific question, your textures will be fine if they are assigned to a shader that is assigned to a material that is referenced by a prefab or existing object, and I also believe the code is searched for any material overrides by name (not certain, but I don't recall ever having issues doing that with missing textures on the final output).

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image S_Rank_Crazy · Feb 01, 2014 at 01:05 PM 0
Share

Thanks a lot for the detailed explanation. Have tested it out and so long as the material is still referencing the image file, it doesn't matter where in the Assets folder the image file lies. $$anonymous$$eaning that i have been able to remove a lot of files that don't need to be compiled for the build.

Thank you again :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

3d model editing and multiple textures per material 0 Answers

Hownto apply textures to materials in unity 5? 4 Answers

Texturing a large surface 2 Answers

Transparency Drawing issues 0 Answers

Skinned Mesh Renderer Material 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges