using UnityEngine; using System.Collections; public class FullScreenUITexture : MonoBehaviour { private UITexture uiTexture; private UISprite uiSprite; void Start() { uiTexture = GetComponent(); uiSprite = GetComponent(); if (uiTexture != null) { uiTexture.width = (int)(Screen.height * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width)*1.05f); uiTexture.height = (int)(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width) * 1.05f); } if (uiSprite != null) { uiSprite.width = (int)(Screen.height * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width) * 1.05f); uiSprite.height = (int)(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width) * 1.05f); } } void Update() { if (uiTexture != null) { uiTexture.width = (int)(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.height) * 1.05f); uiTexture.height = (int)(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width) * 1.05f); } if (uiSprite != null) { uiSprite.width = (int)(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.height) * 1.05f); uiSprite.height = (int)(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width) * 1.05f); } } }