Ejemplo n.º 1
0
    private Ragdoll CreateRagdoll()
    {
        CharacterRagdollTrait trait = base.GetTrait <CharacterRagdollTrait>();

        if (!trait)
        {
            return(null);
        }
        GameObject gameObject = UnityEngine.Object.Instantiate(trait.ragdollPrefab, base.transform.position, base.transform.rotation) as GameObject;
        Ragdoll    component  = gameObject.GetComponent <Ragdoll>();

        component.sourceMain  = base.idMain;
        this._ragdollInstance = gameObject;
        UnityEngine.Object.Destroy(gameObject, 80f);
        this.deathShot.LinkRagdoll(base.transform, gameObject);
        ArmorModelRenderer local = base.GetLocal <ArmorModelRenderer>();
        ArmorModelRenderer armorModelRenderer = component.GetLocal <ArmorModelRenderer>();

        if (local && armorModelRenderer)
        {
            armorModelRenderer.BindArmorModels(local.GetArmorModelMemberMapCopy());
        }
        return(component);
    }
Ejemplo n.º 2
0
    private Ragdoll CreateRagdoll()
    {
        CharacterRagdollTrait trait = base.GetTrait <CharacterRagdollTrait>();

        if (trait == null)
        {
            return(null);
        }
        GameObject obj2      = Object.Instantiate(trait.ragdollPrefab, base.transform.position, base.transform.rotation) as GameObject;
        Ragdoll    component = obj2.GetComponent <Ragdoll>();

        component.sourceMain  = base.idMain;
        this._ragdollInstance = obj2;
        Object.Destroy(obj2, 80f);
        this.deathShot.LinkRagdoll(base.transform, obj2);
        ArmorModelRenderer local     = base.GetLocal <ArmorModelRenderer>();
        ArmorModelRenderer renderer2 = component.GetLocal <ArmorModelRenderer>();

        if ((local != null) && (renderer2 != null))
        {
            renderer2.BindArmorModels(local.GetArmorModelMemberMapCopy());
        }
        return(component);
    }