Esempio n. 1
0
 public static void Load()
 {
     try
     {
         bullets = new BulletInfos();
         UrlDir.UrlConfig[] nodes = GameDatabase.Instance.GetConfigs("BULLET");
         for (int i = 0; i < nodes.Length; i++)
         {
             ConfigNode node = nodes[i].config;
             bullets.Add(
                 new BulletInfo(
                     node.GetValue("name"),
                     float.Parse(node.GetValue("caliber")),
                     float.Parse(node.GetValue("bulletVelocity")),
                     float.Parse(node.GetValue("bulletMass")),
                     Convert.ToBoolean(node.GetValue("explosive")),
                     float.Parse(node.GetValue("tntMass")),
                     float.Parse(node.GetValue("blastPower")),
                     float.Parse(node.GetValue("blastHeat")),
                     float.Parse(node.GetValue("blastRadius")),
                     float.Parse(node.GetValue("apBulletMod")),
                     node.GetValue("bulletDragTypeName")
                     )
                 );
         }
     }
     catch (Exception e)
     {
         Debug.Log("[BDArmory]: Error Loading Bullet Config | " + e.ToString());
     }
 }
Esempio n. 2
0
 public static void Load()
 {
     bullets = new BulletInfos();
     UrlDir.UrlConfig[] nodes = GameDatabase.Instance.GetConfigs("BULLET");
     for (int i = 0; i < nodes.Length; i++)
     {
         ConfigNode node             = nodes[i].config;
         FloatCurve penetrationCurve = new FloatCurve();
         penetrationCurve.Load(node.GetNode("penetration"));
         bullets.Add(new BulletInfo(node.GetValue("name"), float.Parse(node.GetValue("positiveCoefficient")),
                                    penetrationCurve));
     }
 }