- Home /
Replacing (sprite) image, maintaining references
Hello,
I was wondering if it is possible to change an image (in editor) but maintain all the references pointing to that image.
Now when I get a corrected version of an image from our graphical designer, the replacement process is like this:
Drag the new image into the editor. Unfortunately a new instance is created this way and not replacing the old one :(
Delete old one, rename new instance to old name
Drag replaced image into every component that references that image
Are there any simple, replace solution?
Thanks in advance ;)
Answer by Chris_Dlala · Oct 14, 2014 at 09:55 PM
Hi, the easiest way (and the way we replace most assets) is to close unity and use a file browser to overwrite the asset. Then load up Unity and all the references should be in place with the new asset imported using the previous import settings that are stored in the meta file. I hope that helps =)
Thanks for the answer. Yeah, I realised that too (after a while), if I overwrite the image in the file manager then the replace occurs in unity and the references are fine. Although you don't need to close Unity for that ;)
Just use a version control system. There are free ones available too like github or bitbucket. That way the artist can just retouch the PSD or PNG in the unity project, and when you pull the changes, you get the updated file. No hassle. No manual copying and rena$$anonymous$$g
Thanks Chris_Dlala, that works. If you are using the sprite packer (I do in a 2D game), I think you should remember to repack the sprites for the change to be effective.