/// <summary> /// EDITOR ONLY: Used to remove a group and all it's blueprints from the model. /// </summary> public void Delete(BlueprintGroup g) { foreach (var u in blueprints.ToArray()) { if (u.group == g) { Delete(u); } } groups.Remove(g); BlueprintModelAsset.Remove(g); }
public void Delete(UnitStat stat) { foreach (var u in blueprints) { foreach (var c in u.statValues.ToArray()) { if (c.stat == stat) { u.statValues.Remove(c); } } } stats.Remove(stat); BlueprintModelAsset.Remove(stat); }
/// <summary> /// EDITOR ONLY: Used to delete a resource and remove it from all blueprints. /// </summary> public void Delete(Resource resource) { foreach (var u in blueprints) { foreach (var c in u.costs.ToArray()) { if (c.resource == resource) { u.costs.Remove(c); } } } resources.Remove(resource); BlueprintModelAsset.Remove(resource); }
/// <summary> /// EDITOR ONLY: Used to delete a blueprint and remove it from all other blueprints. /// </summary> public void Delete(Blueprint unit) { foreach (var u in blueprints.ToArray()) { foreach (var p in u.prerequisites.ToArray()) { if (p == unit) { u.prerequisites.Remove(p); } } if (u == unit) { blueprints.Remove(u); } } BlueprintModelAsset.Remove(unit); }