예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <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);
         }
     }
 }
예제 #3
0
        /// <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);
        }
예제 #4
0
        /// <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);
            }
        }
예제 #5
0
        /// <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);
        }
예제 #6
0
        /// <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);
            }
        }
예제 #7
0
        /// <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;
        }
예제 #8
0
    /// <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;
    }
예제 #9
0
    /// <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;
    }