/// <summary> /// Removes the quantified vectors in its Global Points list at the given index /// </summary> /// <param name="index"></param> /// <param name="count"></param> private void removePoints(int index, int count) { for (int i = 0; i < count; i++) { if (index >= points.Count) { index = 0; } GlobalPoints.RemoveAt(index); } }
/// <summary> /// Rotates the points forward or backward in the array to change the anchor point /// </summary> /// <param name="points"></param> /// <param name="offset"></param> private void rotatePoints(int newAnchor) { List <Vector2> originalPoints = new List <Vector2>(GlobalPoints.ToArray()); int count = GlobalPoints.Count; for (int i = 0; i < GlobalPoints.Count; i++) { Vector2 v = originalPoints[(i + newAnchor) % count]; GlobalPoints[i] = v; } }
/// <summary> /// Inserts the points given in the vectors array into its Global Points list /// </summary> /// <param name="vectors"></param> /// <param name="index"></param> private void insertPoints(Vector2[] vectors, int index) { try { GlobalPoints.InsertRange(index, vectors); } catch (System.ArgumentOutOfRangeException) { Debug.LogError("AOORE! Global Points Count: " + GlobalPoints.Count + ", index: " + index); } }