@@ -4,17 +4,20 @@ const { Workspace } = require('../index.js');
44Workspace . newF ( "__formSettings" , function ( cl , settings ) {
55 let fixSettings = Soup . from ( settings ) ;
66
7- fixSettings = fixSettings . mapKeys ( ( k , v ) => {
8- let fixed = k . replace ( "m_" , "" ) ;
9- fixed = fixed . split ( "" ) ;
10- if ( fixed [ 1 ] . toUpperCase ( ) != fixed [ 1 ] ) fixed [ 0 ] = fixed [ 0 ] . toLowerCase ( ) ;
11- return fixed . join ( "" ) ;
12- } ) ;
7+ // translate something like m_OcclusionBakeSettings to occlusionBakeSettings
8+ fixSettings = fixSettings . mapKeys ( ( k , v ) => {
9+ let fixed = k . replace ( "m_" , "" ) ; // remove the m_
10+ fixed = fixed . split ( "" ) ; // split it up
11+ if ( fixed [ 1 ] . toUpperCase ( ) != fixed [ 1 ] ) fixed [ 0 ] = fixed [ 0 ] . toLowerCase ( ) ; // if the 2nd character isn't capital turn the first to lowercase
12+ return fixed . join ( "" ) ;
13+ } ) ;
1314
14- fixSettings . map ( ( k , v , i ) => {
15- return new cl . parent . UnityscriptObject ( k , v ) ;
16- } ) ;
15+ // turn everything into unityscript objects
16+ fixSettings . map ( ( k , v , i ) => {
17+ return new cl . parent . UnityscriptObject ( k , v ) ;
18+ } ) ;
1719
18- Object . assign ( cl , fixSettings . pour ( ) ) ;
19- return fixSettings ;
20+ // assign them to the class
21+ Object . assign ( cl , fixSettings . pour ( ) ) ;
22+ return fixSettings ;
2023} ) ;
0 commit comments