public void Click(IAutomatedUIElement element, EventModifiers modifiers = EventModifiers.None) { if (!element.hasRect) { Debug.LogWarning("Cannot click on an element that has no rect"); return; } Click(EventUtility.ConvertGuiViewCoordsToEditorWindowCoords(element.rect.center), modifiers); }
protected virtual IEnumerable <IAutomatedUIElement> FindElements(Func <IAutomatedUIElement, bool> predicate) { if (predicate == null) { throw new ArgumentNullException("predicate"); } // In the future, ArraySegment implements IEnumerable<T>... for (int i = 0; i < descendants.Count; ++i) { IAutomatedUIElement element = descendants.Array[descendants.Offset + i]; if (predicate(element)) { yield return(element); } } }