Unity version 2019.4.29f1c2
All images display correctly in unity edtior. But when I build my project, some of them (including UI images and other 2d sprites)get broken.
The broken image has same setting as others.
================================
I tried reimport images, I think I find the problem, but I can’t fix them.
I replace the broken cloud with other Image, still not working, unless I import image with new guid in meta file by importing with new name. Then I put the new Image (different guid) into the prefab, the cloud is fixed.
Now the problem is:
I have too many broken images, and too many prefab, if I use the method above, I need to change name of all images and rebuild all prefabs in my game.
I have many Spine Resource in my game, and I cannot change the guid of Spine image file.
I think the problem is related to the guid in meta file, anyone can help me?
First try just reimporting all, then check out the device logs when it runs and see if there are any complaints being thrown, particularly shader errors early on in the startup sequence.
Otherwise, start replacing those broken clouds with other clouds, or even with a big purple dinosaur face.
It will either fix it or a new problem will appear!
I tried reimport images, I think I find the problem, but I can’t fix them.
I replace the broken cloud with other Image, still not working, unless I import image with new guid in meta file by importing with new name. Then I put the new Image (different guid) into the prefab, the cloud is fixed.
Now the problem is:
I have too many broken images, and too many prefab, if I use the method above, I need to change name of all images and rebuild all prefabs in my game.
I have many Spine Resource in my game, and I cannot change the guid of Spine image file.
I think the problem is related to the guid in meta file, anyone can help me?
Did you commit those properly to source control? The meta file is 100% as important as the original file. If you delete our change the GUID, everything that uses that asset will break.
SCRIPTS OR ASSETS ARE MISSING OR BLANK
Some info about Missing script warnings, broken prefabs, GUIDs, renaming GUIDs, etc:
EVERYTHING in Unity is connected to the above GUID, which is stored ONLY in the metafile, and hence why the metafiles ALWAYS MUST be source-controlled.
It is super-easy to inadvertently change it by renaming outside of Unity. Don’t do that. Instead:
close Visual Studio (important!)
rename the file(s) in Unity
in Unity do Assets → Open C# Project to reopen Visual Studio
now rename the actual classes, and MAKE SURE THE FILE NAMES DO NOT CHANGE!
If you are NOT using source control while you do this, renaming files is an EXTREMELY dangerous process. Use source control at all times so that you can trivially revert if you miss a critical step and damage your project.