Remove() public method

Removes the ragdoll instance and effect from the animated skeleton.
public Remove ( ) : void
return void
Beispiel #1
0
    public void Reset()
    {
        if (m_ragdollEnabled)
        {
            ragdoll.Remove();
        }

        Destroy(gameObject, 0.0f);
    }
Beispiel #2
0
    IEnumerator Restore()
    {
        Vector3 estimatedPos = ragdoll.EstimatedSkeletonPosition;
        Vector3 rbPosition   = ragdoll.RootRigidbody.position;

        Vector3      skeletonPoint = estimatedPos;
        RaycastHit2D hit           = Physics2D.Raycast((Vector2)rbPosition, (Vector2)(estimatedPos - rbPosition), Vector3.Distance(estimatedPos, rbPosition), groundMask);

        if (hit.collider != null)
        {
            skeletonPoint = hit.point;
        }


        ragdoll.RootRigidbody.isKinematic = true;
        ragdoll.SetSkeletonPosition(skeletonPoint);

        yield return(ragdoll.SmoothMix(0, restoreDuration));

        ragdoll.Remove();

        AddRigidbody();
    }