fix bug when canceling file chooser

add bugs section to readme
This commit is contained in:
EliyaFishman 2022-12-04 19:58:39 +02:00
parent 93790a0c34
commit 897180c51f
2 changed files with 25 additions and 18 deletions

View file

@ -110,9 +110,11 @@ namespace Bread2Unity
{ {
//Choose png and bccad files //Choose png and bccad files
var bccadFilePath = EditorUtility.OpenFilePanel("Open BCCAD File", null, "bccad"); var bccadFilePath = EditorUtility.OpenFilePanel("Open BCCAD File", null, "bccad");
if (!string.IsNullOrEmpty(bccadFilePath))
{
var bccadFileFolder = Path.GetDirectoryName(bccadFilePath); var bccadFileFolder = Path.GetDirectoryName(bccadFilePath);
var pngFilePath = EditorUtility.OpenFilePanel("Open Texture File", bccadFileFolder, "png"); var pngFilePath = EditorUtility.OpenFilePanel("Open Texture File", bccadFileFolder, "png");
if (bccadFilePath != null && pngFilePath != null) if (!string.IsNullOrEmpty(pngFilePath))
{ {
var bccad = BCCAD.Read(File.ReadAllBytes(bccadFilePath)); var bccad = BCCAD.Read(File.ReadAllBytes(bccadFilePath));
var spriteTexture = SpriteCreator.ComputeSprites(bccad, pngFilePath, _prefab.name, shouldRotate); var spriteTexture = SpriteCreator.ComputeSprites(bccad, pngFilePath, _prefab.name, shouldRotate);
@ -132,6 +134,7 @@ namespace Bread2Unity
PrefabCreator.CreatePrefab(_prefab, bccad, _prefabDataList, spriteTexture); PrefabCreator.CreatePrefab(_prefab, bccad, _prefabDataList, spriteTexture);
} }
} }
}
GUILayout.Space(12f); GUILayout.Space(12f);

View file

@ -22,3 +22,7 @@ Rhythm Heaven animation to Unity animation converter
- [ ] change window height and width - [ ] change window height and width
- [ ] write a normal readme - [ ] write a normal readme
### Bugs
- [ ] fix camera taking pictures
- [ ] mices are on top of frame (photo 16)