public static void AlignObjectAxis(GameObject gameObject, AxisAlignmentSettings adjustmentSettings, Vector3 destinationAxis) { if (adjustmentSettings.IsEnabled) { Transform objectTransform = gameObject.transform; objectTransform.rotation = CalculateRotationQuaternionForAxisAlignment(objectTransform.rotation, adjustmentSettings.AlignmentAxis, destinationAxis); } }
public AxisAlignmentSettingsView(AxisAlignmentSettings settings) { _settings = settings; ToggleVisibilityBeforeRender = true; VisibilityToggleLabel = "Axis Alignment"; IndentContent = true; }
private void AlignPlacementGuideAxisWithStrokeSurfaceNormalIfNecessary() { AxisAlignmentSettings surfaceAlignmentSettings = DecorPaintObjectPlacementSettings.Get().SingleDecorPaintModeSettings.PlacementGuideSurfaceAlignmentSettings; AxisAlignment.AlignObjectAxis(ObjectPlacementGuide.SceneObject, surfaceAlignmentSettings, StrokeSurfacePlane.normal); }