BarResizer.cs 522 Bytes
using UnityEngine;
using UnityEngine.UI;

public class BarResizer : MonoBehaviour {

	public HorizontalLayoutGroup barBottomLayout;

	protected void Start ()
	{
		if (Screen.dpi < 140)
		{
			barBottomLayout.spacing = 26;
		}

		// 240
		else if (Screen.dpi < 280)
		{
			barBottomLayout.spacing = 40;
		}

		// 320
		else if (Screen.dpi < 400)
		{
			barBottomLayout.spacing = 88;
		}

		// 480
		else if (Screen.dpi < 500)
		{
			barBottomLayout.spacing = 98;
		}

		else
		{
			barBottomLayout.spacing = 120;
		}
	}

}