コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】シーン保存時に RectTransform の AnchoredPosition3D や SizeDelta を整数に四捨五入するエディタ拡張「UniRectTransformAutoRounder」を GitHub に公開しました

リポジトリ

依存しているパッケージ

https://github.com/baba-s/UniScriptableObjectForPreferences.git

使い方

2020-10-07_195416

RectTransform の AnchoredPosition3D や SizeDelta を整数に四捨五入したいゲームオブジェクトに
「RectTransformAutoRounderTarget」をアタッチした状態でシーンを保存すると、

25

「RectTransformAutoRounderTarget」がアタッチされているゲームオブジェクトと
すべての子オブジェクトの RectTransform の AnchoredPosition3D や SizeDelta を整数に四捨五入されます

2020-10-07_195638

四捨五入の対象外にしたい場合は「RectTransformAutoRounderIgnore」をアタッチします