Ejemplo n.º 1
0
    public void SetRadDollState(AiVitals vitals, Animator animator, NavMeshAgent agent, Rigidbody rb, bool active)
    {
        agent.enabled    = !active;
        rb.isKinematic   = true;
        animator.enabled = !active;
        vitals.GetComponent <AiController>().enabled         = !active;
        vitals.GetComponent <ThirdPersonCharacter>().enabled = !active;

        mainModel.gameObject.SetActive(!active);

        ragdoll.gameObject.SetActive(active);
        ApplyBulletForceToCollider();
    } //set the active state of the ragdoll, trasfer animator velocity to the ragdoll based on rootmotion
Ejemplo n.º 2
0
 private void GetComponents()
 {
     _jobManager          = FindObjectOfType <JobManager>();
     vitals               = GetComponent <Vitals>();
     aiVitals             = GetComponent <AiVitals>();
     fieldOfView          = GetComponent <FieldOfView>();
     inventory            = GetComponentInChildren <GenericInventory>();
     navAgent             = GetComponent <NavMeshAgent>();
     animator             = GetComponent <Animator>();
     weaponHolder         = GetComponent <WeaponHolder>();
     iKControl            = GetComponent <IKControl>();
     thirdPersonCharacter = GetComponent <ThirdPersonCharacter>();
 }