pour l'instant j'ai ce bout de code... mais qui ne fait rien..
le changement de material ou shader n'a aucun impacte (mais c'est assez logique il me semble)
et la piste "detailPrototypes" ne mene qu'a ca dans la doc:
Description: Contains the detail texture/meshes that the terrain has.
Code : Tout sélectionner
GameObject[] terrainObjects = GameObject.FindGameObjectsWithTag ("terrain");
foreach (GameObject go in terrainObjects)
{
if (go.GetComponent<Terrain> () != null)
{
Terrain terr = go.GetComponent<Terrain> ();
terr.materialType = Terrain.MaterialType.Custom;
terr.materialTemplate = colormat;
terr.materialTemplate.shader = grass_light_shad;
DetailPrototype[] myterr = terr.terrainData.detailPrototypes;
}
}
.