public static IEnumerable <KeyValuePair <GameObject, CSGTreeBrushIntersection> > GetAllOverlapping(Vector2 position) { var allOverlapping = new List <GameObject>(); while (true) { GameObject[] ignore = allOverlapping.ToArray(); GameObject[] filter = null; CSGTreeBrushIntersection intersection; var go = PickClosestGameObjectDelegated(position, ref ignore, ref filter, out intersection); if (go == null) { break; } if (allOverlapping.Count > 0 && allOverlapping.Contains(go)) { break; } if (!CSGGeneratedComponentManager.IsObjectGenerated(go)) { yield return(new KeyValuePair <GameObject, CSGTreeBrushIntersection>(go, intersection)); } allOverlapping.Add(go); } }
static bool RemoveGeneratedMeshesFromArray(ref UnityEngine.Object[] selection) { var found = new List <UnityEngine.Object>(); for (int i = selection.Length - 1; i >= 0; i--) { var obj = selection[i]; if (CSGGeneratedComponentManager.IsObjectGenerated(obj)) { continue; } found.Add(obj); } if (selection.Length != found.Count) { selection = found.ToArray(); return(true); } return(false); }