Пример #1
0
 public static float GetSmoothStart5Range(Property p, float t)
 {
     return(p.start + (p.end - p.start) * EZEasings.SmoothStart5(t));
 }
Пример #2
0
    IEnumerator GameOver()
    {
        float t = 0;

        while (exploding)
        {
            if (t < explodeDuration)
            {
                // Debug.Log("growing");
                t += Time.deltaTime;
                transform.localScale = Vector3.one + Vector3.one * targetScale * EZEasings.SmoothStart5(t / explodeDuration);
                yield return(new WaitForEndOfFrame());
            }
            else
            {
                exploding = false;
                waiting   = true;
            }
        }

        // wait at max scale
        t = 0;
        while (waiting)
        {
            if (t < waitDuration)
            {
                // Debug.Log("waiting");
                t += Time.deltaTime;
                yield return(new WaitForEndOfFrame());
            }
            else
            {
                waiting   = false;
                imploding = true;
            }
        }

        Vector3 largeScale = transform.localScale;

        t = 0;
        while (imploding)
        {
            if (t < implodeDuration)
            {
                // Debug.Log("imploding");
                t += Time.deltaTime;
                transform.localScale = largeScale - largeScale * EZEasings.SmoothStop5(t / implodeDuration);

                yield return(new WaitForEndOfFrame());
            }
            else
            {
                transform.localScale = Vector3.zero;
                imploding            = false;
            }
        }

        NewGameManager.GetInstance().ResetGame();

        Destroy(gameObject);
    }