@@ -48,10 +48,18 @@ module.exports = {
4848 }
4949
5050 if ( propertyName === 'bodyType' ) {
51- behaviorContent . getChild ( 'bodyType' ) . setStringValue ( newValue ) ;
51+ const normalizedValue = newValue . toLowerCase ( ) ;
52+ let bodyTypeValue = '' ;
53+ if ( normalizedValue === 'static' ) bodyTypeValue = 'Static' ;
54+ else if ( normalizedValue === 'dynamic' ) bodyTypeValue = 'Dynamic' ;
55+ else if ( normalizedValue === 'kinematic' ) bodyTypeValue = 'Kinematic' ;
56+ else return false ;
57+
58+ behaviorContent . getChild ( 'bodyType' ) . setStringValue ( bodyTypeValue ) ;
5259 if (
53- newValue !== 'Static' &&
54- behaviorContent . getChild ( 'shape' ) . getStringValue ( ) === 'Mesh'
60+ bodyTypeValue !== 'Static' &&
61+ behaviorContent . getChild ( 'shape' ) . getStringValue ( ) . toLowerCase ( ) ===
62+ 'mesh'
5563 ) {
5664 behaviorContent . getChild ( 'shape' ) . setStringValue ( 'Box' ) ;
5765 }
@@ -71,8 +79,17 @@ module.exports = {
7179 }
7280
7381 if ( propertyName === 'shape' ) {
74- behaviorContent . getChild ( 'shape' ) . setStringValue ( newValue ) ;
75- if ( newValue === 'Mesh' ) {
82+ const normalizedValue = newValue . toLowerCase ( ) ;
83+ let shapeValue = '' ;
84+ if ( normalizedValue === 'box' ) shapeValue = 'Box' ;
85+ else if ( normalizedValue === 'capsule' ) shapeValue = 'Capsule' ;
86+ else if ( normalizedValue === 'sphere' ) shapeValue = 'Sphere' ;
87+ else if ( normalizedValue === 'cylinder' ) shapeValue = 'Cylinder' ;
88+ else if ( normalizedValue === 'mesh' ) shapeValue = 'Mesh' ;
89+ else return false ;
90+
91+ behaviorContent . getChild ( 'shape' ) . setStringValue ( shapeValue ) ;
92+ if ( shapeValue === 'Mesh' ) {
7693 behaviorContent . getChild ( 'bodyType' ) . setStringValue ( 'Static' ) ;
7794 }
7895 return true ;
@@ -86,7 +103,16 @@ module.exports = {
86103 }
87104
88105 if ( propertyName === 'shapeOrientation' ) {
89- behaviorContent . getChild ( 'shapeOrientation' ) . setStringValue ( newValue ) ;
106+ const normalizedValue = newValue . toLowerCase ( ) ;
107+ let orientationValue = '' ;
108+ if ( normalizedValue === 'x' ) orientationValue = 'X' ;
109+ else if ( normalizedValue === 'y' ) orientationValue = 'Y' ;
110+ else if ( normalizedValue === 'z' ) orientationValue = 'Z' ;
111+ else return false ;
112+
113+ behaviorContent
114+ . getChild ( 'shapeOrientation' )
115+ . setStringValue ( orientationValue ) ;
90116 return true ;
91117 }
92118
0 commit comments