Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
                }
            }
        }