From 4773e26a929ac80481696e969552f20e06b5d3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8C=80=EC=9B=90?= Date: Thu, 18 Apr 2019 23:50:10 +0900 Subject: [PATCH 1/4] Fixed VisibilityToggle exception in Unity 2018.3 --- Editor/PsdImportWindow.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Editor/PsdImportWindow.cs b/Editor/PsdImportWindow.cs index e883aaf..cc02960 100644 --- a/Editor/PsdImportWindow.cs +++ b/Editor/PsdImportWindow.cs @@ -217,7 +217,19 @@ private void LoadStyles() fontStyle = FontStyle.Bold }; + // XXX: VisibilityToggle style is not exists in Unity 2018.3 +#if UNITY_2018_3_OR_NEWER + tempStyle = new GUIStyle() + { + normal = new GUIStyleState() { background = EditorGUIUtility.Load("Icons/animationvisibilitytoggleoff.png") as Texture2D }, + onNormal = new GUIStyleState() { background = EditorGUIUtility.Load("Icons/animationvisibilitytoggleon.png") as Texture2D }, + fixedHeight = 11, fixedWidth = 13, + border = new RectOffset(2, 2, 2, 2), overflow = new RectOffset(-1, 1, -2, 2), padding = new RectOffset(3, 3, 3, 3), richText = false, + stretchHeight = false, stretchWidth = false, + }; +#else tempStyle = GUI.skin.FindStyle("VisibilityToggle"); +#endif styleVisOff = new GUIStyle(tempStyle) { From 37a12bf314c335fb30ef7beddd15246642f0dee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8C=80=EC=9B=90?= Date: Fri, 14 Jun 2019 12:51:26 +0900 Subject: [PATCH 2/4] add asmdef --- Editor/Psd2UnityImporter-Editor.asmdef | 3 +++ Editor/Psd2UnityImporter-Editor.asmdef.meta | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 Editor/Psd2UnityImporter-Editor.asmdef create mode 100644 Editor/Psd2UnityImporter-Editor.asmdef.meta diff --git a/Editor/Psd2UnityImporter-Editor.asmdef b/Editor/Psd2UnityImporter-Editor.asmdef new file mode 100644 index 0000000..cefd7c0 --- /dev/null +++ b/Editor/Psd2UnityImporter-Editor.asmdef @@ -0,0 +1,3 @@ +{ + "name": "Psd2UnityImporter-Editor" +} \ No newline at end of file diff --git a/Editor/Psd2UnityImporter-Editor.asmdef.meta b/Editor/Psd2UnityImporter-Editor.asmdef.meta new file mode 100644 index 0000000..00a429e --- /dev/null +++ b/Editor/Psd2UnityImporter-Editor.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a2470cc70511464191d8adae826ffbb8 +timeCreated: 1560218377 \ No newline at end of file From 952ea5e87ed11d46ee09463d3a653e527f697898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8C=80=EC=9B=90?= Date: Fri, 14 Jun 2019 14:37:50 +0900 Subject: [PATCH 3/4] fix asmdef to be used only in Editor. --- Editor/Psd2UnityImporter-Editor.asmdef | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Editor/Psd2UnityImporter-Editor.asmdef b/Editor/Psd2UnityImporter-Editor.asmdef index cefd7c0..b90b207 100644 --- a/Editor/Psd2UnityImporter-Editor.asmdef +++ b/Editor/Psd2UnityImporter-Editor.asmdef @@ -1,3 +1,15 @@ { - "name": "Psd2UnityImporter-Editor" + "name": "Psd2UnityImporter-Editor", + "references": [], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [] } \ No newline at end of file From 21fb3ad170583b1c65161f226752a2ec31747084 Mon Sep 17 00:00:00 2001 From: "James Kim (Daewon)" Date: Thu, 22 Aug 2019 17:57:04 +0900 Subject: [PATCH 4/4] Update PsdImporter.cs --- Editor/PsdImporter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Editor/PsdImporter.cs b/Editor/PsdImporter.cs index 48bb50a..3dae121 100644 --- a/Editor/PsdImporter.cs +++ b/Editor/PsdImporter.cs @@ -242,7 +242,7 @@ private static Texture2D GetLayerTexture(PsdDocument psdDoc, PsdLayer psdLayer, return layerTexture; } - private static Texture2D GetTexture(PsdLayer layer) + public static Texture2D GetTexture(PsdLayer layer) { Texture2D texture = new Texture2D(layer.Width, layer.Height); Color32[] pixels = new Color32[layer.Width * layer.Height]; @@ -629,4 +629,4 @@ public static Vector2 AlignmentToPivot(SpriteAlignment spriteAlignment) } #endregion } -} \ No newline at end of file +}