UIManager.cs
520 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using UnityEngine;
using UnityEngine.UI;
public class UIManager : MonoBehaviour {
public HorizontalLayoutGroup barBottomLayout;
protected void Start ()
{
if (Screen.dpi < 140)
{
barBottomLayout.spacing = 22;
}
// 240
else if (Screen.dpi < 280)
{
barBottomLayout.spacing = 44;
}
// 320
else if (Screen.dpi < 400)
{
barBottomLayout.spacing = 80;
}
// 480
else if (Screen.dpi < 500)
{
barBottomLayout.spacing = 92;
}
else
{
barBottomLayout.spacing = 80;
}
}
}