LoadAssetAtPath is a editor only function as the first line of its documentation
tries to imply
When you use resources in the client, you don’t need it cause all resource loading (Load / LoadAll) can only happen from within the Resources folder as thats the only folder that will even transfer to the build without being assigned to prefabs / game objects in scenes included in the build.
Let’s I change to use “Resources.Load”
But it can’t load the texture
How to use this function?
At the reference, it say put the file in “Assets/Resources/glass” and the file name is “glass”
but I don’t know where to put the file, I have a file “texture.png”
that is put the file to “Assets/Resources/texture.png”, then the code is Resources.Load(“texture”);
Right? but it can’t load the file. It is return NULL