示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        RagdollScript ragdoll = other.GetComponent <RagdollScript>();

        if (!ragdoll)
        {
            return;
        }

        ragdoll.EnableRagdoll(transform.position, GetComponent <Rigidbody>()?.velocity.magnitude);
    }
示例#2
0
    private void OnTriggerEnter(Collider other)
    {
        RagdollScript ragdoll = other.GetComponent <RagdollScript>();

        if (!ragdoll)
        {
            return;
        }

        ragdoll.EnableRagdoll();
        rbody.isKinematic = false;
        rbody.AddForce(Vector3.up * SpringForce, ForceMode.VelocityChange);
    }
示例#3
0
        public void Die()
        {
            ArchievementsManager.Instance.UpdateAchievement("murder", 1);

            if (dropItem)
            {
                GameManager.Instance.inventory.SpawnItems(dropItem, transform.position, quantityToDrop);
            }
            if (m_RagdollScript)
            {
                m_RagdollScript.EnableRagdoll();
            }

            ChangeKarma(karmaOnKill);
            ExitCombat();

            StartCoroutine(SetActive(gameObject, false, secondsToDisappear));
        }
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     ragdoll = animator.GetComponentInParent <RagdollScript>();
     ragdoll.EnableRagdoll(50.0f);
 }