Ejemplo n.º 1
0
        private static IEnumerator ChangeRoundingResolutionOnCorner(QuickPolygon shape, int cornerID, float endValue, InterpolateType interpolateType, float duration)
        {
            if (shape.Shape.roundings.Length > cornerID)
            {
                float startValue  = shape.GetRoundingResolution(cornerID);
                float timeElapsed = 0;
                while (timeElapsed < duration)
                {
                    float newvalue = GetInterpolate(interpolateType, startValue, endValue, timeElapsed, duration);
                    shape.SetRoundingResolution(cornerID, newvalue, true);
                    yield return(new WaitForEndOfFrame());

                    timeElapsed += Time.deltaTime;
                }
                shape.SetRoundingResolution(cornerID, endValue, true);
            }
            else
            {
                Debug.LogError(MSG.Errors.WRONG_ROUNDING_CORNER);
            }
        }