コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }