@@ -45,8 +45,12 @@ public bool ShouldProcessSprite(Sprite s)
4545 {
4646 return false ;
4747 }
48-
4948 string path = AssetDatabase . GetAssetPath ( s ) ;
49+ return ShouldProcessSprite ( path ) ;
50+ }
51+
52+ public bool ShouldProcessSprite ( string path )
53+ {
5054 if ( string . IsNullOrEmpty ( path ) || ! path . StartsWith ( "Assets" ) )
5155 {
5256 return false ;
@@ -57,17 +61,17 @@ public bool ShouldProcessSprite(Sprite s)
5761 Regex r = GetRegex ( glob ) ;
5862 if ( r . IsMatch ( path ) )
5963 {
60- Debug . Log ( $ "[SpriteAssistSettings] { path } matches { glob } !") ;
64+ // Debug.Log($"[SpriteAssistSettings] {path} matches {glob}!");
6165 // return true if explicit inclusion is selected, otherwise false for explicit exclusion
6266 return inclusionMode == SpriteAssistInclusionMode . Include ;
6367 }
6468 else
6569 {
66- Debug . Log ( $ "[SpriteAssistSettings] { path } does not match { glob } ") ;
70+ // Debug.Log($"[SpriteAssistSettings] {path} does not match {glob}");
6771 }
6872 }
6973 // fallthru: return true if "include by default", otherwise false
70- Debug . Log ( $ "[SpriteAssistSettings] No match for { path } found") ;
74+ // Debug.Log($"[SpriteAssistSettings] No match for {path} found");
7175 return inclusionMode == SpriteAssistInclusionMode . Exclude ;
7276 }
7377
@@ -92,11 +96,11 @@ private Regex GetRegex(string glob)
9296 private Regex CompileGlob ( string glob )
9397 {
9498 glob = "Assets/" + glob ;
95- Debug . Log ( $ "[SpriteAssistSettings] compiling `${ glob } `") ;
99+ // Debug.Log($"[SpriteAssistSettings] compiling `${glob}`");
96100 return new Regex (
97101 "^" + Regex . Escape ( glob ) . Replace ( @"\*" , ".*" ) . Replace ( @"\?" , "." ) + "$" ,
98102 RegexOptions . IgnoreCase | RegexOptions . Singleline | RegexOptions . Compiled
99103 ) ;
100104 }
101105 }
102- }
106+ }
0 commit comments