Terrain2D.AddQuad(UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector2, UnityEngine.Vector2, bool)

Here are the examples of the csharp api Terrain2D.AddQuad(UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector2, UnityEngine.Vector2, bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : Terrain2D.cs
with GNU General Public License v3.0
from lukakostic

void AddEdge(int aX, int aY, Edge aEdge)
    {
        Vector2 size = new Vector2(1.0f / m_Width, 1.0f / m_Height);
        Vector2 uv = new Vector3(aX * size.x, aY * size.y);
        Vector2 P = uv - Vector2.one * 0.5f;
        uv += size * 0.5f;
        Vector2 P2 = P;
        Vector3 normal;
        if (aEdge == Edge.top)
        {
            P += size;
            P2.y += size.y;
            normal = Vector3.up;
        }
        else if (aEdge == Edge.left)
        {
            P.y += size.y;
            normal = Vector3.left;
        }
        else if (aEdge == Edge.bottom)
        {
            P2.x += size.x;
            normal = Vector3.down;
        }
        else
        {
            P2 += size;
            P.x += size.x;
            normal = Vector3.right;
        }
        AddQuad(P, P2, Vector3.forward * depth, normal, uv, uv, false);
    }