/// <summary> /// Removes quick slot items if they have no source or source is not in permitted groups /// </summary> public void RemoveUnresolvedItems() { foreach (QuickItem quickItem in GetComponentsInChildren <QuickItem>(true)) { bool hit = false; // Chek if item source is child of this GO foreach (Transform parentTransform in AccessUtility.GetComponentsInParent <Transform>(quickItem.itemSource.transform)) { if (permittedSources.Contains(parentTransform.gameObject) == true) { hit = true; break; } } if (hit == false) { // If item source was moved outside or deleted - remove quick item quickItem.Remove(); } } }