コード例 #1
0
        public static Vector2 RegularPolygonVertexPosition(int polygonVertices, int vertexIndex)
        {
            Vector2 result;

            if (vertexIndex < 0 || vertexIndex >= polygonVertices)
            {
                Log.Warning(string.Concat(new object[]
                {
                    "Vertex index out of bounds. polygonVertices=",
                    polygonVertices,
                    " vertexIndex=",
                    vertexIndex
                }), false);
                result = Vector2.zero;
            }
            else if (polygonVertices == 1)
            {
                result = Vector2.zero;
            }
            else
            {
                result = GenGeo.CalculatePolygonVertexPosition(polygonVertices, vertexIndex);
            }
            return(result);
        }
コード例 #2
0
 public static Vector2 RegularPolygonVertexPosition(int polygonVertices, int vertexIndex)
 {
     if (vertexIndex >= 0 && vertexIndex < polygonVertices)
     {
         if (polygonVertices == 1)
         {
             return(Vector2.zero);
         }
         return(GenGeo.CalculatePolygonVertexPosition(polygonVertices, vertexIndex));
     }
     Log.Warning("Vertex index out of bounds. polygonVertices=" + polygonVertices + " vertexIndex=" + vertexIndex);
     return(Vector2.zero);
 }
コード例 #3
0
ファイル: GenGeo.cs プロジェクト: sachdevs/RW-Decompile
 public static Vector2 RegularPolygonVertexPosition(int polygonVertices, int vertexIndex)
 {
     if (vertexIndex < 0 || vertexIndex >= polygonVertices)
     {
         Log.Warning(string.Concat(new object[]
         {
             "Vertex index out of bounds. polygonVertices=",
             polygonVertices,
             " vertexIndex=",
             vertexIndex
         }));
         return(Vector2.zero);
     }
     if (polygonVertices == 1)
     {
         return(Vector2.zero);
     }
     return(GenGeo.CalculatePolygonVertexPosition(polygonVertices, vertexIndex));
 }