C# C语言中的弹跳缓和方程

C# C语言中的弹跳缓和方程,c#,easing,bounce,easing-functions,C#,Easing,Bounce,Easing Functions,我试图在我用C语言制作的游戏元素中添加反弹效果。我似乎找不到正确的放松方程。以下是我目前正在使用的: t.position += (destination-t.position)*0.05f; if((destination-t.position).magnitude <= 0.01f) { t.position = destination; } 有人能帮我把它变成一个反弹方程吗 if(setUpEase) { // Set

我试图在我用C语言制作的游戏元素中添加反弹效果。我似乎找不到正确的放松方程。以下是我目前正在使用的:

t.position += (destination-t.position)*0.05f;
    if((destination-t.position).magnitude <= 0.01f)
    {
        t.position = destination;
    }
有人能帮我把它变成一个反弹方程吗

if(setUpEase)
    {
        // Set the destination of each boardspace
        if(!oneTime)
        {
            beginning = new Vector3(t.position.x, t.position.y, t.position.z);
            destination = new Vector3(t.position.x, t.position.y-10, t.position.z);
            change = new Vector3(0, -10, 0);
            setUpDuration = Random.Range (1.0f, 3.0f);
            oneTime = true;
        }

        // BOUNCING
        currentTime += Time.deltaTime;
        float t2 = currentTime/setUpDuration;
        if(currentTime < setUpDuration)
        {
            if (t2 < (1/2.75f))
            {
                t.position = change*(7.5625f*t2*t2) + beginning;
            }
            else if (t2 < (2/2.75f))
            {
                t.position = change*(7.5625f*(t2-=(1.5f/2.75f))*t2 + 0.75f) + beginning;
            }
            else if (t2 < (2.5f/2.75f))
            {
                t.position = change*(7.5625f*(t2-=(2.25f/2.75f))*t2 + 0.9375f) + beginning;
            }
            else
            {
                t.position = change*(7.5625f*(t2-=(2.625f/2.75f))*t2 + 0.984375f) + beginning;
            }
        }
        else
        {
            t.position = destination;
            if(boardId < 113 && boardId > 92)
                pie.setUpEase2 = true;
            setUpEase=false;
        }
    }