Ejemplo n.º 1
0
    public void GenCutPointNewLine(IntVector2 v1, IntVector2 v2, System.Random rand)
    {
        float      dist        = v1.Distance(v2);
        IntVector2 centerPoint = new IntVector2((v1.x + v2.x) / 2, (v1.y + v2.y) / 2);
        float      radius      = dist / 4;
        IntVector2 result      = VArtifactUtil.GetRandomPointFromPoint(centerPoint, radius, rand);

        AddTownConnection(v1, result, rand);
        AddTownConnection(result, v2, rand);
    }