Пример #1
0
 private GUIStyle GetInspectorStyle(Tower t, int i, bool nada)
 {
     Section s = t.GetSection(i);
     GUIStyle gStyle;
     GUIStyle yStyle;
     GUIStyle rStyle;
     if(nada) {
         gStyle = nadagStyle;
         yStyle = nadayStyle;
         rStyle = nadarStyle;
     } else {
         bool hasWeapon = s.attributes.weapon.GetWeaponType() != "Nothing";
         gStyle = hasWeapon ? wgStyle : ngStyle;
         yStyle = hasWeapon ? wyStyle : nyStyle;
         rStyle = hasWeapon ? wrStyle : nrStyle;
     }
     int stress = t.GetWeightAboveSection(i);
     int maxSP = s.attributes.sp;
     double ratio = (double)stress / (double)maxSP;
     if(ratio < 0.33) {
         return gStyle;
     } else if(ratio >= 0.33 && ratio < 0.66) {
         return yStyle;
     } else {
         return rStyle;
     }
 }