File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . IO ;
13using UnityEditor ;
24using UnityEngine ;
35
@@ -18,21 +20,21 @@ public static Settings Load()
1820
1921 private static Settings CreateAsset ( )
2022 {
21- var folderPath = "Assets/Editor/Resources" ;
23+ var folderPath = "Editor/Resources" ;
24+ var folders = folderPath . Split ( "/" ) ;
25+ var path = Application . dataPath ;
2226
23- var basePath = string . Empty ;
24- var folders = folderPath . Split ( '/' ) ;
25-
26- for ( var i = 1 ; i < folders . Length ; i ++ )
27+ for ( var i = 0 ; i < folders . Length ; i ++ )
2728 {
28- basePath += folders [ i - 1 ] ;
29- if ( AssetDatabase . GUIDFromAssetPath ( $ "{ basePath } /{ folders [ i ] } ") == null )
30- AssetDatabase . CreateFolder ( basePath , folders [ i ] ) ;
31- basePath += "/" ;
29+ path = Path . Combine ( path , folders [ i ] ) ;
30+ if ( ! Directory . Exists ( path ) )
31+ Directory . CreateDirectory ( path ) ;
3232 }
3333
34+ AssetDatabase . Refresh ( ) ;
35+
3436 var settings = CreateInstance < Settings > ( ) ;
35- AssetDatabase . CreateAsset ( settings , $ "{ folderPath } /{ SettingsFilename } .asset") ;
37+ AssetDatabase . CreateAsset ( settings , $ "Assets/ { folderPath } /{ SettingsFilename } .asset") ;
3638 EditorUtility . SetDirty ( settings ) ;
3739
3840 return settings ;
Original file line number Diff line number Diff line change 11{
22 "name" : " dev.klebersilva.tools.bitmapfontcreator" ,
3- "version" : " 1.1.0 " ,
3+ "version" : " 1.1.1 " ,
44 "description" : " A simple tool to create bitmap fonts from a texture sprite sheet to be used with Text component." ,
55 "displayName" : " Bitmap Font Creator" ,
66 "unity" : " 2021.3" ,
You can’t perform that action at this time.
0 commit comments