Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
Set texture of all materials

How do I get all the materials from a gameObject (Some have 5-10 materials) and set the same texture to each of these materials?

public GameObject go;
public Texture texture;
void Start()
{
 go.GetComponent<Renderer>().material.SetTexture("_BaseMap", texture);
}
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I got the way to do this. By getting all materials into an array.


 Material[] myMaterials = gameObject.GetComponent<Renderer> ().materials;
        for (int i = 0; i < myMaterials.Length; i++) {
            myMaterials[i].SetTexture ("_BaseColorMap", texture);
        }
over 4 years ago · Santiago Trujillo Denunciar

0

public GameObject go,go1,go2; Try it this way

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda