- Home /
How to add texture to a script and make the texture work in release build?
I see that in release mode, Unity won't include texture which isn't in the scene. Unity offer Resource folder: Loading Resources at Runtime, The Resources folder, but at the same time, Unity said in "The Resources folder" topic:
2.1. Best Practices for the Resources System
Don't use it.
That why I don't use it.
Here is my situation:
I have a script that stores the textures (Grass Texture, Ground Texture,...) which I'll assign for my run-time terrain creation.
Picture 1:
But soon I realize that these texture won't show up in release build.
But I see that the texture that assign for the Unity's terrain does show up in release build
Picture 2:
So I think if I can add the texture to my script (picture 1) the way Unity's terrain does (picture 2), then maybe Unity will include the texture in release build.
In picture 1, I add the texture to a script but the texture doesn't work in release build, so how can I add texture to a script and make the texture work in release build?