Question by
Lazybones94 · Dec 16, 2016 at 11:26 AM ·
materialdrawcallstexture-atlas
Texture atlases and single material with different offset for multiple 2D objects
I have 10 GameObject
's that share the same texture atlas and same material. At runtime I change the object's offset so that it had the appearance I need. But after I've done it, the draw calls are pretty much the same as if they had different materials and textures. Here is my code:
Renderer thisRenderer = gameobject.GetComponent<Renderer>();
thisRenderer.material.mainTextureOffset = new Vector2(offsetX, offsetY);
What am I doing wrong? I've found something about changing the uv, not offset, but I cannot figure out how to do it.
Comment
Your answer
Follow this Question
Related Questions
script to assign different texture from a single material having all the textures 0 Answers
The same material on several objects with different property (color) 1 Answer
Shader problem? 1 Answer
Help with mesh Texture Seems,Texture Showing Seems 0 Answers
Best way to render hundreds of textures for flooring in an in-game editor? 0 Answers