/// <summary> /// Create a new blueprint field. /// </summary> /// <param name="type">the type of the field</param> /// <param name="source">the source that the building will get data from.</param> public BlueprintField(BuildingType type, GameObject source) { this.type = type; if (source != null) // add a new instance if the source game object isnt null. { BlueprintFieldData fieldData = new BlueprintFieldData(); fieldData.Pack(source); data.Add(fieldData); } }
/// <summary> /// Create a child which contains blueprint data. /// </summary> public void AddChild(GameObject go) { if (go == null) { return; } var child = new BlueprintFieldData(); child.Pack(go); data.Add(child); }