/// <summary> /// Connects the child mount point to the parent /// </summary> /// <param name="rParent">Parent mount point we are connecting to</param> /// <param name="rChild">Child mount point being connected</param> /// <returns>Boolean used to determine if the connection was made</returns> public bool ConnectMountPoints(MountPoint rParentPoint) { if (rParentPoint == null) { return(false); } if (!rParentPoint.AllowChildren) { return(false); } Point.ChildTo(rParentPoint); return(true); }
/// <summary> /// Disconnects thechild mount point from the parent /// </summary> /// <param name="rChildPoint"></param> public void DisconnectMountPoints(MountPoint rParent, GameObject rChildObject) { for (int i = rParent.ChildMountPoints.Count - 1; i >= 0; i--) { MountPoint lChildPoint = rParent.ChildMountPoints[i].MountPoint; if (lChildPoint != null && lChildPoint._Owner == rChildObject) { lChildPoint.ChildTo(null); } } }
/// <summary> /// Disconnects thechild mount point from the parent /// </summary> /// <param name="rChildPoint"></param> public void DisconnectMountPoints(MountPoint rChildPoint) { if (rChildPoint == null) { return; } if (rChildPoint.ParentMountPoint == null) { return; } rChildPoint.ChildTo(null); }
/// <summary> /// Disconnects the child mount point from the parent /// </summary> /// <param name="rParent">Parent mount point who owns the child</param> /// <param name="rChild">Child mount point to disconnect</param> public void DisconnectMountPoints(MountPoint rParent, MountPoint rChild) { if (rParent == null) { return; } if (rChild == null) { return; } if (rChild.ParentMountPoint == rParent) { rChild.ChildTo(null); } }
/// <summary> /// Connects the child mount point to the parent /// </summary> /// <param name="rParent">Parent mount point we are connecting to</param> /// <param name="rChild">Child mount point being connected</param> /// <returns>Boolean used to determine if the connection was made</returns> public bool ConnectMountPoints(MountPoint rParentPoint, MountPoint rChildPoint) { if (rParentPoint == null) { return false; } if (!rParentPoint.AllowChildren) { return false; } if (rChildPoint == null) { return false; } rChildPoint.ChildTo(rParentPoint); return true; }
/// <summary> /// Breaks the connection between the child and parent mount points /// </summary> /// <param name="rChild">Child mount point to break</param> private void DisconnectMountPoints(MountPoint rChild, MountPoint rParent) { if (rChild == null) { return; } rChild.ChildTo(null); // Sanity check to ensure the child is removed from the parent if (rParent != null) { rParent.RemoveChild(rChild); } // Flag the list as needing updating mIsDirty = true; }
/// <summary> /// Manages the connection between two mount points (and thier owners) /// </summary> /// <param name="rChild"></param> /// <param name="rParent"></param> private void ConnectMountPoints(MountPoint rChild, MountPoint rParent) { if (rChild == null) { return; } if (!rChild.IsLocked) { return; } if (rParent != null && !rParent.AllowChildren) { return; } // Parent the two rChild.ChildTo(rParent); // Flag the list as needing updating mIsDirty = true; }