Apply() 공개 메소드

Instantiates the ragdoll simulation and applies its transforms to the skeleton.
public Apply ( ) : void
리턴 void
예제 #1
0
 void Launch()
 {
     RemoveRigidbody();
     ragdoll.Apply();
     ragdoll.RootRigidbody.velocity = new Vector2(Random.Range(-launchVelocity.x, launchVelocity.x), launchVelocity.y);
     StartCoroutine(WaitUntilStopped());
 }
예제 #2
0
    public void Bail(bool showBlood)
    {
        if (m_ragdollEnabled)
        {
            return;
        }

        if (ragdoll == null)
        {
            return;
        }

        ragdoll.Apply();

        m_ragdollEnabled = true;

        if (!isInWater)
        {
            ragdoll.RootRigidbody.velocity = new Vector2(m_RigidBody.velocity.x * 1.5f, 10);
        }
        else
        {
            ragdoll.RootRigidbody.velocity = new Vector2(m_RigidBody.velocity.x * 0.1f, -25);
        }

        int randIndex = Random.Range(0, m_RandomBailClips.Length - 1);

        m_OllieAudio.clip  = m_RandomBailClips[randIndex];
        m_OllieAudio.pitch = 1.4f;
        m_OllieAudio.loop  = false;
        m_OllieAudio.Play();

        // m_cameraShake.originalPos = Camera.main.transform.localPosition;
        // m_cameraShake.shakeDuration = 0.25f;
        // m_cameraShake.shakeAmount = 0.6f;

        if (showBlood && m_ragdollEnabled && bloodEffectsEnabled == false)
        {
            for (int i = 0; i < bloodEffects.Length; ++i)
            {
                bloodEffects[i].gameObject.SetActive(true);
                bloodEffects[i].GetComponent <SwfClipController>().Play(true);
            }

            bloodEffectsEnabled = true;
        }
    }