diff --git a/Editor/Psd2UnityImporter-Editor.asmdef b/Editor/Psd2UnityImporter-Editor.asmdef new file mode 100644 index 0000000..b90b207 --- /dev/null +++ b/Editor/Psd2UnityImporter-Editor.asmdef @@ -0,0 +1,15 @@ +{ + "name": "Psd2UnityImporter-Editor", + "references": [], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [] +} \ 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 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) { 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 +}