BarResizer.cs 959 Bytes
using System;
using UnityEngine;
using UnityEngine.UI;

public class BarResizer : MonoBehaviour {

	public HorizontalLayoutGroup barBottomLayout;
	public GameObject microButton;

	protected void Start ()
	{
#if UNITY_IOS
		this.microButton.SetActive(false);

		if (Screen.dpi < 140)
			this.barBottomLayout.spacing = 42;

		// 240
		else if (Screen.dpi < 280)
			this.barBottomLayout.spacing = 72;

		// 320
		else if (Screen.dpi < 400)
			this.barBottomLayout.spacing = 108;

		// 480
		else if (Screen.dpi < 500)
			this.barBottomLayout.spacing = 158;

		else
			this.barBottomLayout.spacing = 108;
#else
		if (Screen.dpi < 140)
			this.barBottomLayout.spacing = 22;

		// 240
		else if (Screen.dpi < 280)
			this.barBottomLayout.spacing = 44;

		// 320
		else if (Screen.dpi < 400)
			this.barBottomLayout.spacing = 80;

		// 480
		else if (Screen.dpi < 500)
			this.barBottomLayout.spacing = 92;

		else
			this.barBottomLayout.spacing = 80;
#endif
	}

}