private void LoadInfo() { if (info == null) { CUBEInfo[] cubes = CUBE.AllCUBES ?? CUBE.LoadAllCUBEInfo(); info = cubes.Single(c => c.name == target.name); } }
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(); }
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; }
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 } } }
public void SetDescription(CUBEInfo info) { SetDescription(info.name, "description for " + info.name); }