@@ -307,17 +307,17 @@ public static void DisablePartialClassGenerationIfDisallowed(ScriptableObjectCol
307
307
SOCSettings . Instance . SetWriteAsPartialClass ( collection , false ) ;
308
308
}
309
309
}
310
- public static bool CheckIfCanBePartial ( ScriptableObjectCollection collection )
310
+ public static bool CheckIfCanBePartial ( ScriptableObjectCollection collection , string destinationFolder = "" )
311
311
{
312
312
string baseClassPath = AssetDatabase . GetAssetPath ( MonoScript . FromScriptableObject ( collection ) ) ;
313
313
string baseAssembly = CompilationPipeline . GetAssemblyNameFromScriptPath ( baseClassPath ) ;
314
- string targetGeneratedCodePath = CompilationPipeline . GetAssemblyNameFromScriptPath (
315
- AssetDatabase . GetAssetPath ( SOCSettings . Instance . GetGeneratedScriptsParentFolder ( collection ) ) ) ;
314
+ if ( string . IsNullOrEmpty ( destinationFolder ) )
315
+ destinationFolder = CompilationPipeline . GetAssemblyNameFromScriptPath ( SOCSettings . Instance . GetParentFolderPathForCollection ( collection ) ) ;
316
316
317
317
// NOTE: If you're not using assemblies for your code, it's expected that 'targetGeneratedCodePath' would
318
318
// be the same as 'baseAssembly', but it isn't. 'targetGeneratedCodePath' seems to be empty in that case.
319
- bool canBePartial = baseAssembly . Equals ( targetGeneratedCodePath , StringComparison . Ordinal ) ||
320
- string . IsNullOrEmpty ( targetGeneratedCodePath ) ;
319
+ bool canBePartial = baseAssembly . Equals ( destinationFolder , StringComparison . Ordinal ) ||
320
+ string . IsNullOrEmpty ( destinationFolder ) ;
321
321
322
322
return canBePartial ;
323
323
}
@@ -374,10 +374,10 @@ public static void GenerateStaticCollectionScript(ScriptableObjectCollection col
374
374
375
375
string fileName = SOCSettings . Instance . GetStaticFilenameForCollection ( collection ) ;
376
376
string nameSpace = SOCSettings . Instance . GetNamespaceForCollection ( collection ) ;
377
- string finalFolder = AssetDatabase . GetAssetPath ( SOCSettings . Instance . GetGeneratedScriptsParentFolder ( collection ) ) ;
377
+ string finalFolder = AssetDatabase . GetAssetPath ( SOCSettings . Instance . GetParentDefaultAssetScriptsFolderForCollection ( collection ) ) ;
378
378
379
379
bool writeAsPartial = SOCSettings . Instance . GetWriteAsPartialClass ( collection ) ;
380
- bool useBaseClass = SOCSettings . Instance . GetUseBaseClassForITems ( collection ) ;
380
+ bool useBaseClass = SOCSettings . Instance . GetUseBaseClassForItem ( collection ) ;
381
381
382
382
383
383
AssetDatabaseUtils . CreatePathIfDoesntExist ( finalFolder ) ;
@@ -620,7 +620,7 @@ private static void WriteNonAutomaticallyLoadedCollectionItems(ScriptableObjectC
620
620
public static bool DoesStaticFileForCollectionExist ( ScriptableObjectCollection collection )
621
621
{
622
622
return File . Exists ( Path . Combine (
623
- AssetDatabase . GetAssetPath ( SOCSettings . Instance . GetGeneratedScriptsParentFolder ( collection ) ) ,
623
+ AssetDatabase . GetAssetPath ( SOCSettings . Instance . GetParentDefaultAssetScriptsFolderForCollection ( collection ) ) ,
624
624
$ "{ SOCSettings . Instance . GetStaticFilenameForCollection ( collection ) } .g.cs") ) ;
625
625
}
626
626
}
0 commit comments