public void SetScaleDelta(Vector3 scaleDelta, Vector3 scalePivot, Quaternion scaleRotation, bool preferRectResize)
{
this.SetPosition(scaleRotation * Vector3.Scale(Quaternion.Inverse(scaleRotation) * (this.position - scalePivot), scaleDelta) + scalePivot);
Vector3 minDragDifference = ManipulationToolUtility.minDragDifference;
if (this.transform.parent != null)
{
minDragDifference.x /= this.transform.parent.lossyScale.x;
minDragDifference.y /= this.transform.parent.lossyScale.y;
minDragDifference.z /= this.transform.parent.lossyScale.z;
}
Quaternion ownRotation = (!Tools.rectBlueprintMode || !InternalEditorUtility.SupportsRectLayout(this.transform)) ? this.rotation : this.transform.parent.rotation;
Quaternion refAlignment = this.GetRefAlignment(scaleRotation, ownRotation);
scaleDelta = refAlignment * scaleDelta;
scaleDelta = Vector3.Scale(scaleDelta, refAlignment * Vector3.one);
if (preferRectResize && this.rectTransform != null)
{
Vector2 vector = this.sizeDelta + Vector2.Scale(this.rect.size, scaleDelta) - this.rect.size;
vector.x = MathUtils.RoundBasedOnMinimumDifference(vector.x, minDragDifference.x);
vector.y = MathUtils.RoundBasedOnMinimumDifference(vector.y, minDragDifference.y);
this.rectTransform.sizeDelta = vector;
if (this.rectTransform.drivenByObject != null)
{
RectTransform.SendReapplyDrivenProperties(this.rectTransform);
}
}
else
{
this.transform.localScale = Vector3.Scale(this.scale, scaleDelta);
}
}