/// <summary> /// Add a field to the blueprint, works on both runtime and editor. /// </summary> /// <param name="field"></param> public void AddField(BlueprintField field) { if (field != null && !BlueprintField.Contains(field, fields)) { fields.Add(field); Save(); } }
/// <summary> /// Check if a field is contained. /// </summary> /// <param name="field">our field</param> /// <param name="fields">the list of fields</param> /// <returns>is this field already contained?</returns> public static bool Contains(BlueprintField field, List <BlueprintField> fields) { for (int i = 0; i < fields.Count; i++) { if (fields[i].type == field.type) { return(true); } } return(false); }
/// <summary> /// Remove a field from the blueprint, works on both runtime and editor. /// </summary> /// <param name="field"></param> public void RemoveField(BlueprintField field) { fields.Remove(field); Save(); }