public void Deregister(FloatingOriginChild floatingOriginChild) { if (floatingOriginChild.transform.IsChildOf(transform)) { floatingOriginChild.transform.SetParent(null); } floatingOriginChildren.Remove(floatingOriginChild); }
/// <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); }