using UnityEngine;
[RequireComponent
(typeof(UIPanel
))] public class AutoAdjustPanel : MonoBehaviour
{
public float x = 0.3f;
public float y = 0.5f;
public float width = 0.667f;
public float height = 1f;
void Start ()
{
UIPanel panel = GetComponent<UIPanel>();
panel
.clipRange = new Vector4
( Screen.width * (x - 0.5f),
Screen.height * (y - 0.5f),
Screen.width * width,
Screen.height * height);
}
}