private static IEnumerator ChangeDiamondTopWidth(QuickPolygon shape, float endValue, InterpolateType interpolateType, float duration) { float startValue = shape.GetDiamondTopWidth(); float timeElapsed = 0; while (timeElapsed < duration) { float newvalue = GetInterpolate(interpolateType, startValue, endValue, timeElapsed, duration); shape.SetDiamondTopWidth(newvalue, true); yield return(new WaitForEndOfFrame()); timeElapsed += Time.deltaTime; } shape.SetDiamondTopWidth(endValue, true); }