@@ -15,16 +15,12 @@ internal class AssetCreatorHelper
1515 {
1616 private readonly Type _genericType ;
1717 private readonly Type [ ] _argumentTypes ;
18- private readonly string _scriptsPath ;
19- private readonly string _namespaceName ;
2018 private readonly string _fileName ;
2119
22- public AssetCreatorHelper ( Type genericType , Type [ ] argumentTypes , string namespaceName , string scriptsPath , string fileName )
20+ public AssetCreatorHelper ( Type genericType , Type [ ] argumentTypes , string fileName )
2321 {
2422 _genericType = genericType ;
2523 _argumentTypes = argumentTypes ;
26- _namespaceName = namespaceName ;
27- _scriptsPath = scriptsPath ;
2824 _fileName = fileName ;
2925 }
3026
@@ -46,7 +42,7 @@ public void CreateAsset()
4642 return ;
4743 }
4844
49- GenericObjectsPersistentStorage . SaveForAssemblyReload ( genericTypeWithArgs , _namespaceName , _scriptsPath , _fileName ) ;
45+ GenericObjectsPersistentStorage . SaveForAssemblyReload ( genericTypeWithArgs , _fileName ) ;
5046 string className = GetUniqueClassName ( ) ;
5147 CreateScript ( className ) ;
5248 }
@@ -95,7 +91,7 @@ private void CreateScript(string className)
9591 {
9692#if UNITY_EDITOR_WIN
9793 const string longPathPrefix = @"\\?\" ;
98- string fullAssetPath = $ "{ longPathPrefix } { Application . dataPath } /{ _scriptsPath } /{ className } .cs";
94+ string fullAssetPath = $ "{ longPathPrefix } { Application . dataPath } /{ Config . ScriptsPath } /{ className } .cs";
9995
10096 if ( fullAssetPath . Length > 260 + longPathPrefix . Length )
10197 {
@@ -108,15 +104,15 @@ private void CreateScript(string className)
108104
109105 string scriptContent = GetScriptContent ( className ) ;
110106
111- AssetDatabaseHelper . MakeSureFolderExists ( _scriptsPath ) ;
107+ AssetDatabaseHelper . MakeSureFolderExists ( Config . ScriptsPath ) ;
112108 File . WriteAllText ( fullAssetPath , scriptContent ) ;
113109 AssetDatabase . Refresh ( ) ;
114110 }
115111
116112 private string GetScriptContent ( string className )
117113 {
118114 string genericTypeWithBrackets = CreatorUtil . GetFullNameWithBrackets ( _genericType , _argumentTypes ) ;
119- return $ "namespace { _namespaceName } {{ public class { className } : { genericTypeWithBrackets } {{ }} }}";
115+ return $ "namespace { Config . NamespaceName } {{ public class { className } : { genericTypeWithBrackets } {{ }} }}";
120116 }
121117
122118 private void CreateAssetInteractively ( )
0 commit comments