|
Post by ddavee on Jul 31, 2016 2:29:41 GMT
I'm unable to get the code provided above to work, it is complaining that waterMaterial doesn't exist. I'm pretty new to this so I'm sure I missed something, but I just can't figure it out. Any help would be greatly appreciated.
|
|
|
Post by kenamis on Aug 4, 2016 1:44:20 GMT
you'll have to declare it. Try placing it in chunk.cs
public Material chunkMaterial; public Material waterMaterial;
you'll also need to assign it to the right material. I put it in this function "CreateGameObjectWithTextures()"
MeshRenderer mr = chunkObject.GetComponent<MeshRenderer>(); mr.material.SetTexture("_MainTex", diffuse); mr.material.SetTexture("_HeightTex", height);
chunkMaterial = mr.material;
/*new*/ waterMaterial = chunkObject.gameObject.transform.FindChild("Water").GetComponent<MeshRenderer>().material;
SetMarkerMaterials();
|
|
|
Post by kenamis on Aug 4, 2016 1:50:04 GMT
I'm actually working on a "Water" add-on. It will have hexmarkers over the water feature in it with improvements over the technique used in this thread. I'm also planning the ability to have different colors for hexes in the ocean so they you can have different tiles eg; coast, ocean, etc.. I'm going to overhaul the water shader too to have shoreline effects. Let me know if there are any other features you'd like to see related to the water. Let me know if there are any other features you'd like to see in other packs as well.
|
|