private Vector3 GetRatio(ItemScriptableObject item){
float canvasSize = item.canvasDisplaySize;
Sprite showIcon = item.icon;
if(showIcon.bounds.extents.y > showIcon.bounds.extents.x){
float ratio = showIcon.bounds.extents.y/showIcon.bounds.extents.x;
return new Vector3(canvasSize / ratio, canvasSize, canvasSize);
}else{
float ratio = showIcon.bounds.extents.x/showIcon.bounds.extents.y;
return new Vector3(canvasSize, canvasSize / ratio, canvasSize);
}
}

Leave a Reply