private void TransformObj(UiObjectBase o) { var position = o.GameObjectTransform.transform.position; var destinationX = o.GameObjectTransform.transform.position.x * _currentScaleXRatio; var destinationY = o.GameObjectTransform.transform.position.y * _currentScaleYRatio; o.GameObjectTransform.Translate(destinationX - position.x, destinationY - position.y, 0f); }
private void ScaleObj(UiObjectBase o, float xRatio, float yRatio) { var scale = o.GameObjectTransform.localScale; o.GameObjectTransform.localScale = new Vector3(scale.x * xRatio, scale.y * yRatio, scale.z); }