@@ -145,7 +145,33 @@ public void TestParentConstraintExport()
145
145
[ Test ]
146
146
public void TestAimConstraintExport ( )
147
147
{
148
+ List < Object > toExport ;
149
+ var aimConstraint = CreateConstraint < AimConstraint > ( out toExport ) ;
150
+
151
+ GameObject worldUpObject = new GameObject ( "worldUpObject" ) ;
152
+ worldUpObject . transform . localEulerAngles = new Vector3 ( 29 , 190 , 34 ) ;
153
+ toExport . Add ( worldUpObject ) ;
154
+
155
+ aimConstraint . aimVector = new Vector3 ( 20 , 170 , 5 ) ;
156
+ aimConstraint . rotationAtRest = new Vector3 ( 230 , 29 , 49 ) ;
157
+ aimConstraint . rotationAxis = Axis . X | Axis . Y | Axis . Z ;
158
+ aimConstraint . rotationOffset = new Vector3 ( 190 , 120 , 30 ) ;
159
+ aimConstraint . upVector = new Vector3 ( 50 , 280 , 10 ) ;
160
+ aimConstraint . worldUpType = AimConstraint . WorldUpType . ObjectRotationUp ;
161
+ aimConstraint . worldUpObject = worldUpObject . transform ;
162
+ aimConstraint . worldUpVector = new Vector3 ( 94 , 38 , 299 ) ;
148
163
164
+ // export and compare
165
+ var expConstraint = ExportAndCheckConstraint ( aimConstraint , toExport . ToArray ( ) ) ;
166
+
167
+ Assert . That ( expConstraint . aimVector , Is . EqualTo ( aimConstraint . aimVector ) ) ;
168
+ Assert . That ( AreRotationEqual ( expConstraint . rotationAtRest , aimConstraint . rotationAtRest ) , Is . True ) ;
169
+ Assert . That ( expConstraint . rotationAxis , Is . EqualTo ( aimConstraint . rotationAxis ) ) ;
170
+ Assert . That ( AreRotationEqual ( expConstraint . rotationOffset , aimConstraint . rotationOffset ) , Is . True ) ;
171
+ Assert . That ( expConstraint . upVector , Is . EqualTo ( aimConstraint . upVector ) ) ;
172
+ Assert . That ( expConstraint . worldUpType , Is . EqualTo ( aimConstraint . worldUpType ) ) ;
173
+ Assert . That ( expConstraint . worldUpObject . transform , Is . EqualTo ( aimConstraint . worldUpObject . transform ) ) ;
174
+ Assert . That ( expConstraint . worldUpVector , Is . EqualTo ( aimConstraint . worldUpVector ) ) ;
149
175
}
150
176
151
177
0 commit comments