From b5bec07e2730bb9e45b3546b14ef76371acbbefe Mon Sep 17 00:00:00 2001 From: EliyaFishman <45822259+EliyaFishman@users.noreply.github.com> Date: Wed, 7 Dec 2022 17:57:40 +0200 Subject: [PATCH] change window height and width --- Assets/Editor/bread2unity/Bread2Unity.cs | 20 +++++++++++++------- Assets/Editor/bread2unity/README.md | 5 +++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Assets/Editor/bread2unity/Bread2Unity.cs b/Assets/Editor/bread2unity/Bread2Unity.cs index 2d1146ee1..d7a006a9d 100644 --- a/Assets/Editor/bread2unity/Bread2Unity.cs +++ b/Assets/Editor/bread2unity/Bread2Unity.cs @@ -10,24 +10,30 @@ namespace Bread2Unity { public class Bread2UnityGUI : EditorWindow { - public const string EditorFolderName = "bread2unity"; + private const string EditorFolderName = "bread2unity"; + private const float Width = 657; + private const float Height = 442; private GameObject _prefab; private DataModel _animation; private List _prefabDataList = new List(); - private List _animationsIndexes; - private bool shouldRotate = false; + private List _animationsIndexes = new List (); + private bool _shouldRotate; private Vector2 _scrollPosition; [MenuItem("Tools/bread2unity")] public static void ShowWindow() { - GetWindow("bread2unity"); + var window = GetWindow("bread2unity"); + var x = Screen.currentResolution.width / 2f - Width; + var y = Screen.currentResolution.height / 2f - Height; + window.position = new Rect(x,y,Width,Height); } public void CreateGUI() { - _animationsIndexes = new List(); + _animationsIndexes.Add(""); + _prefabDataList.Add(new PrefabData("", 0)); } public void OnGUI() @@ -101,7 +107,7 @@ namespace Bread2Unity GUILayout.Space(12f); // Rotate check box - shouldRotate = GUILayout.Toggle(shouldRotate, "Rotate Spritesheet"); + _shouldRotate = GUILayout.Toggle(_shouldRotate, "Rotate Spritesheet"); GUILayout.Space(12f); @@ -117,7 +123,7 @@ namespace Bread2Unity if (!string.IsNullOrEmpty(pngFilePath)) { 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); //Create prefab from prefab data for (int i = 0; i < _prefabDataList.Count; i++) { diff --git a/Assets/Editor/bread2unity/README.md b/Assets/Editor/bread2unity/README.md index 355286cfa..b3a05ac18 100644 --- a/Assets/Editor/bread2unity/README.md +++ b/Assets/Editor/bread2unity/README.md @@ -18,8 +18,9 @@ Rhythm Heaven animation to Unity animation converter - [x] add translation from steps - [X] remove bccad test -- [ ] add default line for bcaad data -- [ ] change window height and width +- [X] add default line for bcaad data +- [X] change window height and width +- [ ] change sprite order with sprite renderer. - [ ] write a normal readme