Ejemplo n.º 1
0
        /// <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);
            }
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Remove a child which contains data.
 /// </summary>
 public void RemoveChild(BlueprintFieldData child)
 {
     data.Remove(child);
 }