示例#1
0
 /// <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();
     }
 }
示例#2
0
        /// <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);
        }
示例#3
0
 /// <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();
 }