Skip to content

Commit a00c8f4

Browse files
committed
Added ability to choose a percentage of the screen height for the 'auto list height' option on the SelectionBox
1 parent a350e22 commit a00c8f4

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed
56 Bytes
Binary file not shown.
981 Bytes
Binary file not shown.

Assets/MaterialUI/Scripts/Components/SelectionBoxConfig.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class SelectionBoxConfig : MonoBehaviour
3636
public enum PopDirection {Popup, Center, Popdown};
3737
public PopDirection expandDirection = PopDirection.Center;
3838
public bool autoMaxItemHeight;
39+
public float approxPercentageOfHeight = 50f;
3940
public int maxItemHeight;
4041

4142
[Space(12f)]
@@ -202,7 +203,7 @@ public void ExpandList ()
202203

203204
if (autoMaxItemHeight)
204205
{
205-
float tempFloat = (Screen.height / 2f / 36f);
206+
float tempFloat = (Screen.height / 100f * approxPercentageOfHeight / 36f);
206207

207208

208209
if (tempFloat >= listItems.Length)

0 commit comments

Comments
 (0)