예제 #1
0
파일: vRagdoll.cs 프로젝트: kelz67/ZORO
        // active ragdoll - call this method to turn the ragdoll on
        public void ActivateRagdoll()
        {
            if (isActive)
            {
                return;
            }

            inApplyDamage = true;
            isActive      = true;

            if (transform.parent != null)
            {
                transform.parent = null;
            }

            iChar.EnableRagdoll();

            var isDead = !(iChar.currentHealth > 0);

            // turn ragdoll on
            inStabilize = true;
            ragdolled   = true;

            // start to check if the ragdoll is stable
            StartCoroutine(RagdollStabilizer(2f));

            if (!isDead)
            {
                characterHips.parent = null;
            }
            Invoke("ResetDamage", 0.2f);
        }
예제 #2
0
        //**********************************************************************************//
        // ACTIVATE RAGDOLL                                                                 //
        // call this method to activate the ragdoll											//
        //**********************************************************************************//
        public void ActivateRagdoll()
        {
            if (isActive)
            {
                return;
            }

            isActive = true;
            //Debug.Log("Ragdoll ON");

            animator.SetBool("GetUpFromBack", false);
            animator.SetBool("GetUpFromBelly", false);

            iChar.EnableRagdoll();

            var isDead = !(iChar.currentHealth > 0);

            if (isDead)
            {
                transform.SendMessage("DropRightWeapon", SendMessageOptions.DontRequireReceiver);
                transform.SendMessage("DropLeftWeapon", SendMessageOptions.DontRequireReceiver);
                Destroy(animator);
            }
            // turn ragdoll on
            ragdolled = true;

            // start to check if the ragdoll is stable
            inStabilize = true;
        }