Example #1
0
    private void HandleNormal()
    {
        Vector3 position = base.transform.position;

        if (position.y < netBody.despawnHeight + 10f)
        {
            GiftSpawn randomSpawn = group.GetRandomSpawn();
            Vector3   position2   = randomSpawn.GetPosition();
            netBody.Respawn(position2 - netBody.startPos + Vector3.up * Random.Range(20, 30));
            phase        = GiftPhase.Chute;
            targetHeight = position2.y;
        }
    }
Example #2
0
    private void HandleChute()
    {
        float   num      = 0f;
        Vector3 position = base.transform.position;
        float   num2     = position.y - targetHeight;

        num = ((!(num2 < 3f)) ? Mathf.InverseLerp(15f, 5f, num2) : Mathf.InverseLerp(2f, 3f, num2));
        if (num2 < 2f)
        {
            phase = GiftPhase.Normal;
        }
        else
        {
            Vector3 velocity = body.velocity;
            if (velocity.y < -1f * (2f - num))
            {
                body.SafeAddForce(Vector3.up * 50f * num, ForceMode.Acceleration);
            }
        }
        ApplyChutePhase(num);
    }