/// <summary> /// Check if given button shuld bw visible with current filters setting. /// </summary> /// <returns><c>true</c>, if should be visible, <c>false</c> otherwise.</returns> /// <param name="button">Button.</param> protected bool CheckFilter(BaseBrickButton button) { return ((groupFilter == 0 || button.group == groupFilter) && (nameFilter == "" || button.name.IndexOf(nameFilter, StringComparison.OrdinalIgnoreCase) > 0)); }
/// <summary> /// Check if button is visible in list container window. /// </summary> /// <returns><c>true</c>, if button visible was ised, <c>false</c> otherwise.</returns> /// <param name="button">Button.</param> /// <param name="yRange">Y range of the conatainer x is y min, y is y max.</param> protected bool IsButtonVisible(BaseBrickButton button, Vector2 yRange) { Vector3[] corners = new Vector3[4]; button.rectTransform.GetWorldCorners(corners); if ((corners[0].y > yRange.x && corners[0].y < yRange.y) || (corners[1].y > yRange.x && corners[1].y < yRange.y)) { return(true); } return(false); }