Version: 2022.2
public static void SnapToGrid (Transform[] transforms, SnapAxis axis);
public static void SnapToGrid (Vector3[] positions, SnapAxis axis);

参数

transforms 要对齐的变换。
positions The positions to snap.
axis 要应用对齐的轴。

描述

Rounds each Transform.position or Vector3 to the closest multiple of EditorSnapSettings.gridSize.