예제 #1
0
    public Square(ControlNode _topLeft, ControlNode _topRight, ControlNode _bottomRight, ControlNode _bottomLeft)
    {
        topLeft     = _topLeft;
        topRight    = _topRight;
        bottomRight = _bottomRight;
        bottomLeft  = _bottomLeft;

        centerTop    = topLeft.right;
        centerRight  = bottomRight.above;
        centerBottom = bottomLeft.right;
        centerLeft   = bottomLeft.above;

        if (topLeft.active)
        {
            configuration += 8;
        }
        if (topRight.active)
        {
            configuration += 4;
        }
        if (bottomRight.active)
        {
            configuration += 2;
        }
        if (bottomLeft.active)
        {
            configuration += 1;
        }
    }
예제 #2
0
 public ControlNode(Vector3 _pos, bool _active, float squareSize) : base(_pos)
 {
     active = _active;
     above  = new AVeryStrangelyNamedNode(position + Vector3.up * squareSize / 2f);
     right  = new AVeryStrangelyNamedNode(position + Vector3.right * squareSize / 2f);
 }
예제 #3
0
 private void CreateTriangle(AVeryStrangelyNamedNode a, AVeryStrangelyNamedNode b, AVeryStrangelyNamedNode c)
 {
     triangles.Add(a.vertexIndex);
     triangles.Add(b.vertexIndex);
     triangles.Add(c.vertexIndex);
 }