i'm using the packedsprite script for my scenes in unity. it's an ipad project, so each scene has a 2048x2048 sheet. so far, two scenes. what's great is that the smaller sprites stay where they belong. unfortunately, when i build atlas with the 1024x768 background (on each scene), one cancels out the other. i go back into the other scene to rebuild the atlas, and the background from the previous scene gets deleted. a vicious cycle.
they both are assigned different materials to go onto different sprite sheets, so i can't see the problem here. i even tried forcing the square when building the atlas... not that i want them on the same sheet, but there's plenty of room for it so i don't see why one is deleted all together.
can't seem to find a solution so any help would be appreciated.
Brady gave me this excellent response that worked like a charm ::
That sounds like that one or both of two things is happening:
1) There is an object in the open scene that uses the material of the object in the un-opened scene, and so it is over-writing the contents of that material's atlas.
2) There is a prefab in the project folder that uses a material of objects in un-opened scenes, and those objects in the un-opened scenes aren't linked to prefabs themselves, and so they get "left out" of the atlas build.
This is why it is strongly recommended to make sure each type of sprite in your game is linked to a prefab, because since Unity doesn't provide access to objects in non-open scenes, this is how information gets synchronized between scenes.
If you've already done this and it is still happening, go to your scene instances of your prefabs with which you're having trouble, and make sure they are re-connected to their source prefab by selecting them and clicking the "Revert" button in the inspector. This will make sure none of their values have been overridden.
answered May 01 '11 at 04:25 PM