public void destroy() { foreach (var child in _children) { child.manager.removeElement(child); } _manager.removeFromTouchables(this); }
/// <summary> /// Override so that we can remove the touchable sprites. The container needs to manage all touches. /// </summary> public override void addChild(params UISprite[] children) { base.addChild(children); // after the children are added we can grab the width/height which are freshly calculated _contentSize.x = _contentWidth; _contentSize.y = _contentHeight; calculateMinMaxInsets(); foreach (var child in children) { if (child is ITouchable) { _manager.removeFromTouchables(child as ITouchable); } } }
/// <summary> /// Override so that we can remove the touchable sprites. The container needs to manage all touches. /// </summary> public override void addChild(params UISprite[] children) { base.addChild(children); // after the children are added we can grab the width/height which are freshly calculated if _suspendUpdates is false if (!_suspendUpdates) { calculateMinMaxInsets(); } // we will manually handle touches so remove any children that are touchable foreach (var child in children) { if (child is ITouchable) { _manager.removeFromTouchables(child as ITouchable); } } }