简体   繁体   English

更改场景中所有纹理的最佳方法

[英]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 Unity Answers, I've raised the same question there . 如果你是统一答案的频繁用户,我已经提出了同样的问题存在

Make them all the child of a single empty object (call it TextureController or something) and attach a script to that that changes the texture of all of its children? 使它们成为单个空对象(称为TextureController之类)的所有子对象,并将脚本附加到该脚本上,以更改其所有子对象的纹理? It would be an efficient way if it's possible given your setup. 如果可以的话,这将是一种有效的方法。 Hope it helps :) 希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM