// Token: 0x060017F5 RID: 6133 RVA: 0x00081768 File Offset: 0x0007F968 public void SpawnRagdoll(DamageInfo damageInfo) { AvatarGearParts ragdollGear = this.Loadout.GetRagdollGear(); this.Ragdoll = global::AvatarBuilder.InstantiateRagdoll(ragdollGear, this.Decorator.Configuration.GetSkinColor()); try { ragdollGear.DestroyGearParts(); this.Ragdoll.transform.position = this.Decorator.transform.position; this.Ragdoll.transform.rotation = this.Decorator.transform.rotation; AvatarDecoratorConfig.CopyBones(this.Decorator.Configuration, this.Ragdoll); foreach (ArrowProjectile arrowProjectile in this.Decorator.GetComponentsInChildren <ArrowProjectile>(true)) { Vector3 localPosition = arrowProjectile.transform.localPosition; Quaternion localRotation = arrowProjectile.transform.localRotation; arrowProjectile.transform.parent = this.Ragdoll.GetBone(BoneIndex.Hips); arrowProjectile.transform.localPosition = localPosition; arrowProjectile.transform.localRotation = localRotation; } foreach (Rigidbody rigidbody in this.Ragdoll.GetComponentsInChildren <Rigidbody>(true)) { if (rigidbody.gameObject.GetComponent <RagdollBodyPart>() == null) { rigidbody.gameObject.AddComponent <RagdollBodyPart>(); } } this.Ragdoll.ApplyDamageToRagdoll(damageInfo); this.Decorator.gameObject.SetActive(false); } catch (Exception message) { Debug.LogWarning(message); } }
// Token: 0x06001282 RID: 4738 RVA: 0x0006E5A4 File Offset: 0x0006C7A4 public static AvatarDecoratorConfig InstantiateRagdoll(AvatarGearParts gear, Color skinColor) { SkinnedMeshCombiner.Combine(gear.Base, gear.Parts); LayerUtil.SetLayerRecursively(gear.Base.transform, UberstrikeLayer.Ragdoll); gear.Base.GetComponent <SkinnedMeshRenderer>().updateWhenOffscreen = true; AvatarDecoratorConfig component = gear.Base.GetComponent <AvatarDecoratorConfig>(); component.SetSkinColor(skinColor); return(component); }
// Token: 0x060017F4 RID: 6132 RVA: 0x000816FC File Offset: 0x0007F8FC public void CleanupRagdoll() { if (this.Ragdoll) { global::AvatarBuilder.Destroy(this.Ragdoll.gameObject); this.Ragdoll = null; if (this.Decorator && this.Decorator.gameObject) { this.Decorator.gameObject.SetActive(true); } } }
// Token: 0x0600182B RID: 6187 RVA: 0x0008205C File Offset: 0x0008025C public static void CopyBones(AvatarDecoratorConfig srcAvatar, AvatarDecoratorConfig dstAvatar) { foreach (AvatarBone avatarBone in srcAvatar._avatarBones) { Transform bone = dstAvatar.GetBone(avatarBone.Bone); if (bone) { bone.position = avatarBone.Transform.position; bone.rotation = avatarBone.Transform.rotation; } } }
// Token: 0x06001502 RID: 5378 RVA: 0x00076CDC File Offset: 0x00074EDC private AvatarDecoratorConfig CreateLutzRavinoff(Loadout gearLoadout) { AvatarDecoratorConfig defaultRagdoll = PrefabManager.Instance.DefaultRagdoll; AvatarDecoratorConfig avatarDecoratorConfig = UnityEngine.Object.Instantiate(defaultRagdoll) as AvatarDecoratorConfig; List <GameObject> list = new List <GameObject>(); SkinnedMeshCombiner.Combine(avatarDecoratorConfig.gameObject, list); foreach (GameObject obj in list) { UnityEngine.Object.Destroy(obj); } return(avatarDecoratorConfig); }
// Token: 0x06001503 RID: 5379 RVA: 0x00076D5C File Offset: 0x00074F5C private AvatarDecoratorConfig CreateHolo(IUnityItem holo) { AvatarDecoratorConfig avatarDecoratorConfig = null; GameObject gameObject = holo.Create(Vector3.zero, Quaternion.identity); HoloGearItem component = gameObject.GetComponent <HoloGearItem>(); if (component && component.Configuration.Ragdoll) { avatarDecoratorConfig = (UnityEngine.Object.Instantiate(component.Configuration.Ragdoll) as AvatarDecoratorConfig); LayerUtil.SetLayerRecursively(avatarDecoratorConfig.transform, UberstrikeLayer.Ragdoll); SkinnedMeshCombiner.Combine(avatarDecoratorConfig.gameObject, new List <GameObject>()); } UnityEngine.Object.Destroy(gameObject); return(avatarDecoratorConfig); }