Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by rfernandezmir · Aug 14, 2013 at 08:57 AM · c#gameobjecttextureperformance

Most optimal way of changing all textures on scene

I'm looking for the best way of changing the texture of all the gameobjects on scene. I need a way that affects the performance as little as possible. One of the possibilities I've considered is to attach a script to all those objects that are texturized and then somehow call a function that affects all those objects that had this script attached. However, I'm not sure how to do so, thus if some of you knows, I'd appreciate any advice. I'd also appreciate it if you could propose more optimal ways to achieve the same result. Thanks for your time.

If you are a frequent user of StackOverFlow, I've raised the same question there.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by robertbu · Aug 15, 2013 at 12:28 AM

Since you are using C#, a nice way to communicate the change to all the scripts is to use Events and Delegates. Here is a video tutorial on the subject:

http://www.youtube.com/watch?v=N2zdwKIsXJs

As for the actual change itself, efficiency will depend on your game setup. The best setups use use a texture atlas and change the textures by directly changing the uv in the mesh. This allows different objects with different textures (but all other material settings the same), to be drawn in a single draw call. But even for a single object, changing the uvs has benefits. This type of change of textures can be difficult to do without third-party tools. A couple of links:

http://answers.unity3d.com/questions/14578/whats-the-best-way-to-reduce-draw-calls.html

http://docs.unity3d.com/Documentation/Manual/DrawCallBatching.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

How to make the Health bar on Enemys head not be in relation to Player(main) Camera? 2 Answers

2D Side Scroller Background 3 Answers

Mesh.CombineMeshes does not work when mergeSubMeshes=false 2 Answers

Generate many (32k) GameObjects approach 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges