ok so this may be a little hard to understand but I’ll give it a try.
I need the blocks to be different colors depending on the block type selected, yes all the blocks should be red (to start) but then when switching block types you can place different colors using this code:
public void DrawFace(Vector3 start, Vector3 offset1, Vector3 offset2, byte block)
{
int index = verts.Count;
verts.Add (start);
verts.Add (start + offset1);
verts.Add (start + offset2);
verts.Add (start + offset1 + offset2);
Vector2 uvBase;
switch (block)
{
default:
uvBase = new Vector2(0.25f,0.25f);
break;
case 2:
uvBase = new Vector2(0.75f,0.75f);
break;
case 3:
uvBase = new Vector2(0.25f, 0.75f);
break;
}
if ((offset1 == Vector3.right) && (offset2 == Vector3.back))
{
uv.Add (uvBase);
uv.Add (uvBase + new Vector2(0.125f, 0));
uv.Add (uvBase + new Vector2(0, 0.125f));
uv.Add (uvBase + new Vector2(0.125f, 0.125f));
}
else
{
uv.Add (uvBase);
uv.Add (uvBase + new Vector2(-0.125f, 0));
uv.Add (uvBase + new Vector2(0, 0.125f));
uv.Add (uvBase + new Vector2(-0.125f, 0.125f));
}
To realy help understand go here
and fast forward to 13:00.
This is the Tile Mat I am trying to use

