UIManagerLoading.cs
822 Bytes
using UnityEngine;
using UnityEngine.UI;
public class UIManagerLoading : UIManager {
public Text text;
public Image image;
protected override void rebuild(float scale)
{
float textHeight = Screen.height / 2;
// text
{
text.fontSize = (int)( text.fontSize * scale );
Vector2 textSize = text.GetComponent<RectTransform>().sizeDelta;
textSize.y = textHeight;
text.GetComponent<RectTransform>().sizeDelta = textSize;
Vector3 textPosition = text.transform.position;
textPosition.y = (3 * Screen.height) / 4;
text.transform.position = textPosition;
}
// image
{
image.transform.localScale = new Vector3(scale, scale, 1);
Vector3 imagePosition = image.transform.position;
imagePosition.y = textHeight - (90 * scale);
image.transform.position = imagePosition;
}
}
}