Skip to content

Commit 3705233

Browse files
committed
Merge branch 'hotfix/1.1.1'
2 parents 897360a + c860092 commit 3705233

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Editor/Model/Settings/Settings.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
using System.IO;
13
using UnityEditor;
24
using 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;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

0 commit comments

Comments
 (0)