Is there any way at all to do per-object uv offset from an editor script (not at runtime)?

Hey guys, I’m trying to build a world builder to streamline our pipeline a bit. we have a number of 3d modular environment bits that the user can place quickly and easily by clicking about in a top-down view.

to save on draw calls, I’d like every object to be able to reference a section on a texture atlas. However, i’d like to be able to also have a varied version for every textured object, so we can do things like checkered floors with a single floor tile, etc. We want to split our texture atlas into two halves, and have the varied version on the second half of the sheet. I would then uv offset each object that we want to be varied to use the right-half of the texture atlas.

However, it doesn’t look like I can offset the uvs for a single mesh in the editor, because all of the prefabs in the scene are referencing the same mesh file in the project. Does anyone have any ideas on how I could accomplish this effect?

If altering the meshes in the Editor means it results in many meshes, rather than one prefab mesh, and you don’t want that, then I’d re-think using one texture. Split the texture into two separate ones and reassign that on each instance, because that surely won’t break the prefab.

I have done something similar to what you’re doing though, I have a flag on my script saying which material to use, and the Start routine on the prefab will assign the correct settings. So it is at runtime, but only during Start.