void InitScale() { if (_scale == null) { _scale = new SLayoutFloatProperty { getter = () => transform.localScale.x, setter = s => transform.localScale = new Vector3(s, s, s) }; } }
void InitHeight() { if (_height == null) { _height = new SLayoutFloatProperty { getter = () => rectTransform.rect.height, setter = SetRectTransformHeight }; } }
void InitWidth() { if (_width == null) { _width = new SLayoutFloatProperty { getter = () => rectTransform.rect.width, setter = SetRectTransformWidth }; } }
void InitY() { if (_y == null) { _y = new SLayoutFloatProperty { getter = () => GetRectTransformY(rectTransform), setter = SetRectTransformY }; } }
void InitX() { if (_x == null) { _x = new SLayoutFloatProperty { getter = () => GetRectTransformX(rectTransform), setter = SetRectTransformX }; } }
void InitGroupAlpha() { if (_groupAlpha == null) { _groupAlpha = new SLayoutFloatProperty { getter = () => canvasGroup ? canvasGroup.alpha : 1.0f, setter = a => { if (canvasGroup) { canvasGroup.alpha = a; } } }; } }