示例#1
0
 protected Vector3 GetNormal(ENext _nei)
 {
     switch(_nei)
     {
         case ENext.TOP: return Vector3.forward;
         case ENext.BOTTOM: return Vector3.back;
         case ENext.LEFT: return Vector3.left;
         case ENext.RIGHT: return Vector3.right;
     }
     return Vector3.up;
 }
示例#2
0
    protected Vector3 GetEndOfEdge(int _Index, ENext _nei)
    {
        if(_nei == ENext.RIGHT || _nei == ENext.TOP)
        {
            return points[_Index] + GetNormal(ENext.RIGHT) * tileScale + GetNormal(ENext.TOP) * tileScale;
        }
        if(_nei == ENext.BOTTOM)
        {
            return points[_Index] + GetNormal(ENext.RIGHT) * tileScale;
        }

        return points[_Index] + GetNormal(ENext.TOP) * tileScale;
    }
示例#3
0
 protected Vector3 GetNeighbor(int _Index, ENext _nei)
 {
     return points[_Index] + GetNormal(_nei) * tileScale;
 }
示例#4
0
    protected OutlineEdge GetEdge(int _Index, ENext _net)
    {
        OutlineEdge e = new OutlineEdge();
        if(_net == ENext.RIGHT || _net == ENext.TOP)
        {
            e.start = GetNeighbor(_Index, _net);
            e.end = GetEndOfEdge(_Index, _net);
        }else
        {
            e.start = points[_Index];
            e.end = GetEndOfEdge(_Index, _net);
        }

            e.normal = GetNormal(_net);

        return e;
    }