private static IEnumerator ChangeResolution(QuickPolygon shape, int endValue, InterpolateType interpolateType, float duration) { int startValue = shape.GetResolution(); float timeElapsed = 0; while (timeElapsed < duration) { float value = GetInterpolate(interpolateType, startValue, endValue, timeElapsed, duration); int newvalue = Mathf.RoundToInt(value); shape.SetResolution(newvalue, true); yield return(new WaitForEndOfFrame()); timeElapsed += Time.deltaTime; } shape.SetResolution(endValue, true); }