Пример #1
0
 private void LoadInfo()
 {
     if (info == null)
     {
         CUBEInfo[] cubes = CUBE.AllCUBES ?? CUBE.LoadAllCUBEInfo();
         info = cubes.Single(c => c.name == target.name);
     }
 }
Пример #2
0
        public void SetStats(CUBEInfo info)
        {
            stats.SetActive(true);
            description.SetActive(false);

            nameLabel.text = info.name;
            healthLabel.text = info.health.ToString();
            shieldLabel.text = info.shield.ToString();
            speedLabel.text = info.speed.ToString();
            damageLabel.text = info.damage.ToString();
            costLabel.text = info.cost.ToString();
        }
Пример #3
0
 public CUBEInfo(CUBEInfo other)
 {
     // General Stats
     name = other.name;
     ID = other.ID;
     type = other.type;
     // System Stats
     subsystem = other.subsystem;
     brand = other.brand;
     grade = other.grade;
     // Combat Stats
     health = other.health;
     shield = other.shield;
     speed = other.speed;
     damage = other.damage;
     // Part Stats
     size = other.size;
     cost = other.cost;
     rarity = other.rarity;
     price = other.price;
 }
Пример #4
0
 private static void ToBinary(CUBEInfo[] info)
 {
     using (BinaryWriter writer = new BinaryWriter(File.Open(CUBEListPathEditor, FileMode.Create)))
     {
         foreach (var cube in info)
         {
             writer.Write(cube.name); // name
             writer.Write(cube.ID); // ID
             writer.Write((int)cube.type); // type
             writer.Write((int)cube.subsystem); // subsystem
             writer.Write((int)cube.brand); // brand
             writer.Write(cube.grade); // grade
             writer.Write(cube.health); // health
             writer.Write(cube.shield); // shield
             writer.Write(cube.speed); // speed
             writer.Write(cube.damage); // damage
             writer.Write(cube.size.ToString()); // size
             writer.Write(cube.cost); // cost
             writer.Write(cube.rarity); // rarity
             writer.Write(cube.price); // price
         }
     }
 }
Пример #5
0
 public void SetDescription(CUBEInfo info)
 {
     SetDescription(info.name, "description for " + info.name);
 }