private static void BindRenderer <TArmorModel>(ArmorModelRenderer prefabRenderer, ArmorDataBlock armor, MeshFilter filter, MeshRenderer renderer) where TArmorModel : ArmorModel <TArmorModel>, new() { TArmorModel armorModel; if (armor != null) { armorModel = armor.GetArmorModel <TArmorModel>(); if ((armorModel == null) && (prefabRenderer != null)) { armorModel = prefabRenderer.GetArmorModel <TArmorModel>(); } } else if (prefabRenderer != null) { armorModel = prefabRenderer.GetArmorModel <TArmorModel>(); } else { return; } if (armorModel != null) { Mesh mesh; if (ArmorModelRenderer.Censored && (armorModel.censoredModel != null)) { armorModel = armorModel.censoredModel; } if ((armorModel != null) && armorModel.actorMeshInfo.FindPose("sleep", out mesh)) { filter.sharedMesh = mesh; renderer.sharedMaterials = armorModel.sharedMaterials; } } }
public static ArmorModel GetArmorModelByUniqueID(int uniqueID, ArmorModelSlot slot) { ArmorDataBlock byUniqueID = GetByUniqueID(uniqueID) as ArmorDataBlock; if (byUniqueID == null) { return(null); } return(byUniqueID.GetArmorModel(slot)); }
public static TArmorModel GetArmorModelByUniqueID <TArmorModel>(int uniqueID) where TArmorModel : ArmorModel, new() { ArmorDataBlock byUniqueID = GetByUniqueID(uniqueID) as ArmorDataBlock; if (byUniqueID == null) { return(null); } return(byUniqueID.GetArmorModel <TArmorModel>()); }
public static ArmorModel GetArmorModelByUniqueID(int uniqueID, ArmorModelSlot slot) { ArmorDataBlock byUniqueID = DatablockDictionary.GetByUniqueID(uniqueID) as ArmorDataBlock; if (!byUniqueID) { return(null); } return(byUniqueID.GetArmorModel(slot)); }
public static TArmorModel GetArmorModelByUniqueID <TArmorModel>(int uniqueID) where TArmorModel : ArmorModel, new() { ArmorDataBlock byUniqueID = DatablockDictionary.GetByUniqueID(uniqueID) as ArmorDataBlock; if (!byUniqueID) { return((TArmorModel)null); } return(byUniqueID.GetArmorModel <TArmorModel>()); }
private static bool BindArmorMap <TArmorModel>(ArmorDataBlock armor, ref ArmorModelMemberMap map) where TArmorModel : ArmorModel, new() { if (armor != null) { TArmorModel armorModel = armor.GetArmorModel <TArmorModel>(); if (armorModel != null) { map.SetArmorModel <TArmorModel>(armorModel); return(true); } } return(false); }