예제 #1
0
 /// <summary>
 /// Removes the given child if object is in fact a child of this object.
 /// </summary>
 /// <param name="child">The child to emancipate.</param>
 public void RemoveChild(WWObjectData child)
 {
     if (children.Contains(child))
     {
         children.Remove(child);
     }
 }
예제 #2
0
        /// <summary>
        /// Initialize the WWObject
        /// </summary>
        /// <param name="objectData">The instance data for the WWObject.</param>
        /// <param name="resourceMetadata">The resource meta data that describes this WWObject.</param>
        public void Init(WWObjectData objectData, WWResourceMetadata resourceMetadata)
        {
            this.objectData       = objectData;
            this.ResourceMetadata = resourceMetadata;
            var switchMaterial = Resources.Load("Materials/TileFadeMat") as Material;

            MaterialSwitcher = new MaterialSwitcher(gameObject, switchMaterial);
        }
예제 #3
0
 /// <summary>
 /// Constructs a new WWObjectData instance with the provided data.
 /// </summary>
 /// <param name="id">The unique id.</param>
 /// <param name="wwTransform">The WWTransform.</param>
 /// <param name="parent">The parent WWObjectData. Can be null</param>
 /// <param name="children">The list of children this WWObjectData is a parent of.</param>
 /// <param name="resourceTag">The resource tag</param>
 public WWObjectData(Guid id, WWTransform wwTransform,
                     WWObjectData parent, List <WWObjectData> children, string resourceTag)
 {
     this.id          = id;
     this.wwTransform = wwTransform;
     this.parent      = parent;
     this.children    = children;
     this.resourceTag = resourceTag;
 }
예제 #4
0
 /// <summary>
 /// Set the parent object for this object.
 /// </summary>
 /// <param name="parent">The parent object for this object to become a child of.</param>
 public void SetParent(WWObjectData parent)
 {
     this.parent = parent;
 }