Синтаксис:
Используется javascript
function Awake() {
RefreshAspect();
}
function RefreshAspect() {
var aspect: float = 1/Camera.main.aspect;
transform.localScale.x = transform.localScale.y * aspect * guiElement.texture.width/guiElement.texture.height;
transform.position = transform.localPosition;
}
RefreshAspect();
}
function RefreshAspect() {
var aspect: float = 1/Camera.main.aspect;
transform.localScale.x = transform.localScale.y * aspect * guiElement.texture.width/guiElement.texture.height;
transform.position = transform.localPosition;
}
Масштабируется все хорошо, но при изменении отношения сторон с 4:3 на 16:9 смещается позиция текстуры. Может кто подскажет в чем дело и куда копать?