private bool RebindHead(RagdollPresetMetadata preset, bool forceRebuild) { if (head != null && (forceRebuild || !allowHead || preset == null || preset.head == null || preset.head.modelPath != head.meta.folder)) { head.Unbind(ragdoll); UnityEngine.Object.DestroyImmediate(head.gameObject); head = null; } if (head == null && allowHead && preset != null && preset.head != null) { RagdollModelMetadata item = WorkshopRepository.instance.GetPartRepository(WorkshopItemType.ModelHead).GetItem(preset.head.modelPath); if (item != null) { head = BindToSkin(item); return(true); } } return(false); }
private bool RebindLower(RagdollPresetMetadata preset, bool forceRebuild) { if (lower != null && (forceRebuild || !allowLower || preset == null || preset.lowerBody == null || preset.lowerBody.modelPath != lower.meta.folder)) { lower.Unbind(ragdoll); UnityEngine.Object.DestroyImmediate(lower.gameObject); lower = null; } if (lower == null && allowLower && preset != null && preset.lowerBody != null) { RagdollModelMetadata item = WorkshopRepository.instance.GetPartRepository(WorkshopItemType.ModelLowerBody).GetItem(preset.lowerBody.modelPath); if (item != null) { lower = BindToSkin(item); return(true); } } return(false); }
private bool RebindMain(RagdollPresetMetadata preset, bool forceRebuild) { if (main != null && (forceRebuild || preset == null || preset.main == null || main.meta.folder != preset.main.modelPath)) { main.Unbind(ragdoll); UnityEngine.Object.DestroyImmediate(main.gameObject); main = null; } if (main == null && preset != null && preset.main != null) { RagdollModelMetadata item = WorkshopRepository.instance.GetPartRepository(WorkshopItemType.ModelFull).GetItem(preset.main.modelPath); if (item != null) { main = BindToSkin(item); return(true); } } return(false); }
public void RebindColors(RagdollModel model, bool bake, bool compress) { model.texture.ApplyPresetColors(preset, bake, compress); }