File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ private void Update()
3737 for ( ; parts != null && i < parts . Count ; i ++ )
3838 {
3939 AvailablePart ap = parts [ i ] ;
40- if ( ap . partUrl != null && ap . partUrl != "" )
40+ if ( ap . partUrl != null && ap . partUrl != "" && ap . TechRequired != "Unresearcheable" )
4141 {
4242 Part part = ap . partPrefab ;
4343 TextureUnloaderPartModule module = ( TextureUnloaderPartModule ) part . AddModule ( typeof ( TextureUnloaderPartModule ) . Name ) ;
@@ -46,6 +46,10 @@ private void Update()
4646 module . Load ( moduleNode ) ;
4747 module . Unload ( true ) ;
4848 }
49+ else
50+ {
51+ Log ( ap . name + " Not unloaded." ) ;
52+ }
4953 }
5054 partLoadedIndex = i ;
5155 }
@@ -96,11 +100,15 @@ private void Start()
96100 {
97101 foreach ( AvailablePart ap in PartLoader . LoadedPartsList )
98102 {
99- if ( ap . partUrl != null && ap . partUrl != "" )
103+
104+ Part part = ap . partPrefab ;
105+ if ( part != null )
100106 {
101- Part part = ap . partPrefab ;
102107 TextureUnloaderPartModule module = ( TextureUnloaderPartModule ) part . FindModuleImplementing < TextureUnloaderPartModule > ( ) ;
103- module . Unload ( true ) ;
108+ if ( module != null )
109+ {
110+ module . Unload ( true ) ;
111+ }
104112 }
105113 }
106114 unloaded = true ;
You can’t perform that action at this time.
0 commit comments