示例#1
0
        public void Deregister(FloatingOriginChild floatingOriginChild)
        {
            if (floatingOriginChild.transform.IsChildOf(transform))
            {
                floatingOriginChild.transform.SetParent(null);
            }

            floatingOriginChildren.Remove(floatingOriginChild);
        }
示例#2
0
        /// <summary>
        /// Register a new floating origin child.
        /// </summary>
        /// <param name="floatingOriginChild">The new floating origin child.</param>
        public void Register(FloatingOriginChild floatingOriginChild)
        {
            // Parent to floating origin manager if not already.
            if (floatingOriginChild.transform.root != transform)
            {
                floatingOriginChild.transform.SetParent(transform);
            }

            // Add the new floating origin child to the list.
            floatingOriginChildren.Add(floatingOriginChild);
        }