Exemple #1
0
 public void SetMeshesVisible(bool set)
 {
     foreach (KeyValuePair <int, ArmorData> keyValuePair in this.m_LimbMap)
     {
         ArmorData value = keyValuePair.Value;
         if (value.m_ArmorType != ArmorType.None)
         {
             if (set)
             {
                 if (value.IsArmorDestroyed())
                 {
                     value.m_MeshMap[(int)value.m_ArmorType].SetActive(false);
                     value.m_DestroyedMesh.SetActive(true);
                     if (value.m_Cloth)
                     {
                         value.m_Cloth.enabled = false;
                         value.m_Cloth.enabled = true;
                     }
                 }
                 else
                 {
                     value.m_MeshMap[(int)value.m_ArmorType].SetActive(true);
                     value.m_DestroyedMesh.SetActive(false);
                 }
             }
             else
             {
                 value.m_MeshMap[(int)value.m_ArmorType].SetActive(false);
                 value.m_DestroyedMesh.SetActive(false);
             }
         }
     }
 }
Exemple #2
0
    public float GetAbsorption(Limb limb)
    {
        ArmorData armorData = this.m_LimbMap[(int)limb];

        if (armorData.m_ArmorType != ArmorType.None && !armorData.IsArmorDestroyed())
        {
            return(CJTools.Math.GetProportionalClamp(armorData.m_MinAbsorption, 1f, armorData.m_AttachedArmor.m_Info.m_Health, 0f, armorData.m_AttachedArmor.m_Info.m_MaxHealth) * armorData.m_Absorption);
        }
        return(0f);
    }