Beispiel #1
0
    private void Die()
    {
        isDead = !isDead;

        //Debug.Log(gameObject.name + " died!");
        var animator = GetComponent <Animator>();
        var navAgent = GetComponent <NavMeshAgent>();
        var rb       = GetComponent <Rigidbody>();

        // var lastColliderHitName = WeaponManager.Instance.ColliderHit.name;
        // Debug.Log(lastColliderHitName);

        if (isDead) //turn into interface
        {
            RagdollController.CopyTransformData(ragDollController.mainModel, ragDollController.ragdoll, animator.velocity);
            ragDollController.SetRadDollState(this, animator, navAgent, rb, true);
        }
        else
        {
            ragDollController.SetRadDollState(this, animator, navAgent, rb, false);
        }

        GameManager.Instance.OnKilledAi(_aiController);

        //ragDollController.ApplyBulletForceToCollider(lastColliderHitName);
    }