void initMesh(Transform t) { Debug.Log("init mesh"); if (col_set == null || tgopt == null) { Debug.Log("missing variables"); return; } terrain_mm = new MinMax(); col_gen = new ColourGenerator(col_set); col_gen.updateColours(); mesh_obj = new GameObject("mesh"); mesh_obj.transform.parent = t; Vector3 pos = new Vector3(t.position.x + x, t.position.y, t.position.z + y); mesh_obj.transform.position = pos; MeshRenderer mr = mesh_obj.AddComponent <MeshRenderer>(); mr.sharedMaterial = col_set.material; //mr.sharedMaterial = new Material(Shader.Find("Standard")); //mr.sharedMaterial.color = col_set.colour; mesh_filter = mesh_obj.AddComponent <MeshFilter>(); mesh_filter.mesh = new Mesh(); }
public void onColChange() { Debug.Log("On col_set change"); col_gen.updateColours(); mesh_obj.GetComponent <MeshRenderer>().sharedMaterial = col_set.material; //mesh_obj.GetComponent<MeshRenderer>().sharedMaterial.color = col_set.colour; }
void generateColours() { ColourGenerator.updateColours(); }
public void generateColor() { colourGenerator.updateColours(); Debug.Log("GenerandoColor"); }