File tree Expand file tree Collapse file tree 3 files changed +37
-25
lines changed
unity/upms/core/Editor/Src Expand file tree Collapse file tree 3 files changed +37
-25
lines changed Original file line number Diff line number Diff line change 1313using UnityEditor . Experimental . AssetImporters ;
1414#endif
1515using UnityEngine ;
16-
17- [ ScriptedImporter ( 1 , "cjs" ) ]
18- public class CJSImporter : ScriptedImporter
16+
17+ namespace Puerts . Editor
1918{
20- public override void OnImportAsset ( AssetImportContext ctx )
19+ [ ScriptedImporter ( 1 , "cjs" ) ]
20+ public class CJSImporter : ScriptedImporter
2121 {
22- TextAsset subAsset = new TextAsset ( File . ReadAllText ( ctx . assetPath ) ) ;
23- ctx . AddObjectToAsset ( "text" , subAsset ) ;
24- ctx . SetMainObject ( subAsset ) ;
22+ public override void OnImportAsset ( AssetImportContext ctx )
23+ {
24+ TextAsset subAsset = new TextAsset ( File . ReadAllText ( ctx . assetPath ) ) ;
25+ ctx . AddObjectToAsset ( "text" , subAsset ) ;
26+ ctx . SetMainObject ( subAsset ) ;
2527
26- #if ENABLE_CJS_AUTO_RELOAD
27- Puerts . JsEnv . ClearAllModuleCaches ( ) ;
28- #endif
28+ #if ENABLE_CJS_AUTO_RELOAD
29+ Puerts . JsEnv . ClearAllModuleCaches ( ) ;
30+ #endif
31+ }
2932 }
33+
3034}
3135
3236#endif
Original file line number Diff line number Diff line change 1313using UnityEditor . Experimental . AssetImporters ;
1414#endif
1515using UnityEngine ;
16-
17- [ ScriptedImporter ( 1 , "lua" ) ]
18- public class LuaImporter : ScriptedImporter
16+
17+ namespace Puerts . Editor
1918{
20- public override void OnImportAsset ( AssetImportContext ctx )
19+ [ ScriptedImporter ( 1 , "lua" ) ]
20+ public class LuaImporter : ScriptedImporter
2121 {
22- TextAsset subAsset = new TextAsset ( File . ReadAllText ( ctx . assetPath ) ) ;
23- ctx . AddObjectToAsset ( "text" , subAsset ) ;
24- ctx . SetMainObject ( subAsset ) ;
22+ public override void OnImportAsset ( AssetImportContext ctx )
23+ {
24+ TextAsset subAsset = new TextAsset ( File . ReadAllText ( ctx . assetPath ) ) ;
25+ ctx . AddObjectToAsset ( "text" , subAsset ) ;
26+ ctx . SetMainObject ( subAsset ) ;
27+ }
2528 }
29+
2630}
2731
2832#endif
Original file line number Diff line number Diff line change 1313using UnityEditor . Experimental . AssetImporters ;
1414#endif
1515using UnityEngine ;
16-
17- [ ScriptedImporter ( 1 , "mjs" ) ]
18- public class MJSImporter : ScriptedImporter
16+
17+ namespace Puerts . Editor
1918{
20- public override void OnImportAsset ( AssetImportContext ctx )
19+ [ ScriptedImporter ( 1 , "mjs" ) ]
20+ public class MJSImporter : ScriptedImporter
2121 {
22- TextAsset subAsset = new TextAsset ( File . ReadAllText ( ctx . assetPath ) ) ;
23- ctx . AddObjectToAsset ( "text" , subAsset ) ;
24- ctx . SetMainObject ( subAsset ) ;
22+ public override void OnImportAsset ( AssetImportContext ctx )
23+ {
24+ TextAsset subAsset = new TextAsset ( File . ReadAllText ( ctx . assetPath ) ) ;
25+ ctx . AddObjectToAsset ( "text" , subAsset ) ;
26+ ctx . SetMainObject ( subAsset ) ;
2527
2628#if ENABLE_CJS_AUTO_RELOAD
27- Puerts . JsEnv . ClearAllModuleCaches ( ) ;
29+ Puerts . JsEnv . ClearAllModuleCaches ( ) ;
2830#endif
31+ }
2932 }
33+
3034}
3135
3236#endif
You can’t perform that action at this time.
0 commit comments