GithubHelp home page GithubHelp logo

kyubuns / akyuiunity Goto Github PK

View Code? Open in Web Editor NEW
416.0 14.0 42.0 46.26 MB

Adobe XD to Akyui to Unity UI

Home Page: https://kyubuns.dev/akyui/

License: MIT License

C# 92.39% ShaderLab 6.48% HLSL 1.13%
unity ui akyui adobe-xd xd-files

akyuiunity's Introduction

AkyuiUnity

AkyuiUnity is a Unity implementation of Akyui.
With AkyuiUnity.Xd, you can easily generate Unity Prefab from Adobe XD files.

Read this document in other languages: 日本語


What is AkyuiUnity / AkyuiUnity.Xd?

Akyui is a UI definition file format created by kyubuns.
AkyuiUnity is able to generate UnityPrefab from Akyui, and
AkyuiUnity.Xd can convert XD files to Akyui.
By combining the two, you can generate UnityPrefab from XD files without being aware of Akyui.

Features

Everything done on Unity

  • Just drag and drop your XD files.
    • There's no need to open Adobe XD to import.
  • Since everything is done in Unity, you can leave it to the build machine and so on.

Follow XD file updates

  • Designers can continue to work on the UI in Adobe XD.
  • Since only the differences are imported, the import time is reduced after the second import.

No runtime effect

  • AkyuiUnity only creates the prefab, so there's no cost at runtime.

Highly customizable

  • You can easily write your own triggers (extension scripts) to generate a Prefab that fits your project.
    • For example, you can use the triggers included in the package to do the following
      • Automatically convert materials to 9SliceSprite to reduce textures.
      • Use TextMeshPro instead of uGUI's Text.
      • Do not convert objects with specific names on XD files to Unity.

Users' Manual

Installation

UnityPackageManager

  • AkyuiUnity https://github.com/kyubuns/AkyuiUnity.git?path=Assets/AkyuiUnity
  • AkyuiUnity.Xd https://github.com/kyubuns/AkyuiUnity.git?path=Assets/AkyuiUnity.Xd

Target Environment

  • Unity2019.4 or later

License

MIT License (see LICENSE)

SpecialThanks

akyuiunity's People

Contributors

c3-hoge-fuga-piyo avatar kyubuns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akyuiunity's Issues

Import XD file error

FormatException: Input string was not in a correct format.
System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) (at :0)
System.Number.ParseDouble (System.ReadOnlySpan1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) (at <eef08f56e2e042f1b3027eca477293d9>:0) System.Double.Parse (System.String s) (at <eef08f56e2e042f1b3027eca477293d9>:0) Utf8Json.Internal.DoubleConversion.StringToDoubleConverter.StringToIeee (Utf8Json.Internal.DoubleConversion.Iterator input, System.Int32 length, System.Boolean read_as_double, System.Int32& processed_characters_count) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Internal/DoubleConversion/StringToDoubleConverter.cs:615) Utf8Json.Internal.DoubleConversion.StringToDoubleConverter.ToSingle (System.Byte[] buffer, System.Int32 offset, System.Int32& readCount) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Internal/DoubleConversion/StringToDoubleConverter.cs:133) Utf8Json.JsonReader.ReadSingle () (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonReader.cs:1148) Utf8Json.Formatters.XdParser_Internal_XdTransformJsonFormatter19.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdClipPathResourcesJsonFormatter36.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectMetaUxJsonFormatter21.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectMetaJsonFormatter20.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdArtboardChildArtboardJsonFormatter44.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdArtboardChildJsonFormatter5.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdArtboardJsonFormatter4.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.JsonSerializer.Deserialize[T] (System.Byte[] bytes, System.Int32 offset, Utf8Json.IJsonFormatterResolver resolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonSerializer.cs:213) Utf8Json.JsonSerializer.Deserialize[T] (System.Byte[] bytes, Utf8Json.IJsonFormatterResolver resolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonSerializer.cs:199) Utf8Json.JsonSerializer.Deserialize[T] (System.String json, Utf8Json.IJsonFormatterResolver resolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonSerializer.cs:189) Utf8Json.JsonSerializer.Deserialize[T] (System.String json) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonSerializer.cs:184) XdParser.XdFile..ctor (System.String xdFilePath) (at ./Library/PackageCache/dev.kyubuns.akyuiunityxd@93d29b65b4/Editor/Libraries/XdParser/XdParser.cs:33) AkyuiUnity.Xd.XdImporter.ImportedArtboards (AkyuiUnity.Xd.XdImportSettings xdSettings, AkyuiUnity.Editor.AkyuiLogger logger, System.String xdFilePath, AkyuiUnity.Editor.IAkyuiProgress progress, System.Collections.Generic.List1[T] loaders) (at ./Library/PackageCache/dev.kyubuns.akyuiunityxd@93d29b65b4/Editor/XdImporter.cs:75)
AkyuiUnity.Xd.XdImporter.Import (AkyuiUnity.Xd.XdImportSettings xdSettings, System.String[] xdFilePaths) (at ./Library/PackageCache/dev.kyubuns.akyuiunityxd@93d29b65b4/Editor/XdImporter.cs:36)
AkyuiUnity.Xd.XdImportSettingsEditor.OnInspectorGUI () (at ./Library/PackageCache/dev.kyubuns.akyuiunityxd@93d29b65b4/Editor/XdImportSettingsEditor.cs:38)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.b__0 () (at <347e3e2bef8c4deb82c9790c6e198135>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

I didn't get any results

I am trying to upload the design I created in the Adobe xd project into my Unity project. I integrated the AkyuiUnity project into my Unity project without any problems. I dragged my project with .xd extension to Drop xd and dropped it. However, I received the reply that your transaction was created without adding anything. I am sharing the screenshot with you. I would be glad if you could help me solve my problem.

Unity_mFZhlEYk2f

Import XD file error

FormatException: Input string was not in a correct format.
System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) (at :0)
System.Number.ParseDouble (System.ReadOnlySpan1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) (at <eef08f56e2e042f1b3027eca477293d9>:0) System.Double.Parse (System.String s) (at <eef08f56e2e042f1b3027eca477293d9>:0) Utf8Json.Internal.DoubleConversion.StringToDoubleConverter.StringToIeee (Utf8Json.Internal.DoubleConversion.Iterator input, System.Int32 length, System.Boolean read_as_double, System.Int32& processed_characters_count) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Internal/DoubleConversion/StringToDoubleConverter.cs:615) Utf8Json.Internal.DoubleConversion.StringToDoubleConverter.ToSingle (System.Byte[] buffer, System.Int32 offset, System.Int32& readCount) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Internal/DoubleConversion/StringToDoubleConverter.cs:133) Utf8Json.JsonReader.ReadSingle () (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonReader.cs:1148) Utf8Json.Formatters.XdParser_Internal_XdTransformJsonFormatter19.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdClipPathResourcesJsonFormatter36.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectMetaUxJsonFormatter21.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectMetaJsonFormatter20.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdObjectGroupJsonFormatter22.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.XdParser_Internal_XdObjectJsonFormatter18.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68)
Utf8Json.Formatters.XdParser_Internal_XdArtboardChildArtboardJsonFormatter44.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.XdParser_Internal_XdArtboardChildJsonFormatter5.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0)
Utf8Json.Formatters.ArrayFormatter1[T].Deserialize (Utf8Json.JsonReader& reader, Utf8Json.IJsonFormatterResolver formatterResolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/Formatters/CollectionFormatters.cs:68) Utf8Json.Formatters.XdParser_Internal_XdArtboardJsonFormatter4.Deserialize (Utf8Json.JsonReader& , Utf8Json.IJsonFormatterResolver ) (at <8402c97719c340a9a8bc6d4104f8c646>:0) Utf8Json.JsonSerializer.Deserialize[T] (System.Byte[] bytes, System.Int32 offset, Utf8Json.IJsonFormatterResolver resolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonSerializer.cs:213) Utf8Json.JsonSerializer.Deserialize[T] (System.Byte[] bytes, Utf8Json.IJsonFormatterResolver resolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonSerializer.cs:199) Utf8Json.JsonSerializer.Deserialize[T] (System.String json, Utf8Json.IJsonFormatterResolver resolver) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonSerializer.cs:189) Utf8Json.JsonSerializer.Deserialize[T] (System.String json) (at ./Library/PackageCache/dev.kyubuns.akyuiunity@93d29b65b4/Loader/Libraries/Utf8Json/JsonSerializer.cs:184) XdParser.XdFile..ctor (System.String xdFilePath) (at ./Library/PackageCache/dev.kyubuns.akyuiunityxd@93d29b65b4/Editor/Libraries/XdParser/XdParser.cs:33) AkyuiUnity.Xd.XdImporter.ImportedArtboards (AkyuiUnity.Xd.XdImportSettings xdSettings, AkyuiUnity.Editor.AkyuiLogger logger, System.String xdFilePath, AkyuiUnity.Editor.IAkyuiProgress progress, System.Collections.Generic.List1[T] loaders) (at ./Library/PackageCache/dev.kyubuns.akyuiunityxd@93d29b65b4/Editor/XdImporter.cs:75)
AkyuiUnity.Xd.XdImporter.Import (AkyuiUnity.Xd.XdImportSettings xdSettings, System.String[] xdFilePaths) (at ./Library/PackageCache/dev.kyubuns.akyuiunityxd@93d29b65b4/Editor/XdImporter.cs:36)
AkyuiUnity.Xd.XdImportSettingsEditor.OnInspectorGUI () (at ./Library/PackageCache/dev.kyubuns.akyuiunityxd@93d29b65b4/Editor/XdImportSettingsEditor.cs:38)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.b__0 () (at <347e3e2bef8c4deb82c9790c6e198135>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Parallel Import に対応していません

Describe the bug
A clear and concise description of what the bug is.

Parallel Import が有効になっているとテクスチャが正しくインポートできず生成されたプレハブも不正な状態になってしまいました。


Importer.ImportAssetPostProcessImportAsset.ProcessingFile などを設定し AssetDatabase.ImportAsset を通して PostProcessImportAsset.OnPreprocessAsset を呼び出していますが、 Parallel Import が有効になっている場合インポート処理が行われるのはワーカースレッド上になるためここusing スコープを抜けた( PostProcessImportAsset.ProcessingFile などがリセットされた)後に PostProcessImportAsset.OnPreprocessAsset が呼ばれここでブロックされてしまい、結果テクスチャのインポート設定が意図していない状態になります( Sprite になっていない、 userData が空など)

ImportAssetOptions.ForceSynchronousImport を指定して AssetDatabase.ImportAsset を行うように処理を変更してみましたが、手元の環境だとワーカースレッド上でインポート処理を行うことは変わらずで今回の問題への対応とはならず、 Parallel Import に対応するには時間がかかりそうだっため一旦 Issue という形で提起させていただきました。

To Reproduce
Steps to reproduce the behavior:

  1. Project Settings/Editor/Asset Pipeline/Parallel Import を有効にする
    • 反映にUnity エディタの再起動が必要
  2. 画像を含む適当な XD ファイルを XdImportSettings 経由でインポートする
  3. アセットは生成されるが内容が正しくない
    • テクスチャがデフォルトのインポート設定のまま( Sprite になっていない)ため、uGUIから参照できずにUIコンポーネントの Source Image などがすべて None になる
    • PostProcessImportAsset.OnPreprocessAsset がスキップされるため、 userData にJSONデータが入らずここ で例外が発生する

※非同期処理による問題なので環境によらず再現できるか不明です…… 🙇

Expected behavior
A clear and concise description of what you expected to happen.

Parallel Import が有効になっていてもアセットが正しい状態で生成される。

Environment

  • Windows 10
  • Unity 2022.2.0f1
  • 7a2baa1

※Parallel Import 自体は Unity 2021.2 から提供されているため、おそらくこれ以降のバージョンなら発生する可能性があります。

improt XD Error:

branches:main
NullReferenceException: Object reference not set to an instance of an object
Unity.VectorGraphics.Editor.SVGImporter.BuildTexture (UnityEngine.Sprite sprite, System.String name) (at Library/PackageCache/[email protected]/Editor/SVGImporter.cs:552)
Unity.VectorGraphics.Editor.SVGImporter.GenerateTexturedSpriteAsset (UnityEditor.AssetImporters.AssetImportContext ctx, UnityEngine.Sprite sprite, System.String name) (at Library/PackageCache/[email protected]/Editor/SVGImporter.cs:452)
Unity.VectorGraphics.Editor.SVGImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at Library/PackageCache/[email protected]/Editor/SVGImporter.cs:336)
UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.AssetDatabase:ImportAsset(String)
AkyuiUnity.Xd.SvgToPng:Convert(String, Vector2, ViewportOptions, XdImportSettings) (at Assets/AkyuiUnity.Xd/Editor/Svg/SvgToPng.cs:52)
AkyuiUnity.Xd.<>c__DisplayClass5_2:b__0() (at Assets/AkyuiUnity.Xd/Editor/XdObjectParser/ShapeObjectParser.cs:126)
AkyuiUnity.Xd.XdAssetHolder:Load(String) (at Assets/AkyuiUnity.Xd/Editor/XdAssetHolder.cs:41)
AkyuiUnity.Xd.XdAkyuiLoader:LoadAsset(String) (at Assets/AkyuiUnity.Xd/Editor/XdAkyuiLoader.cs:69)
AkyuiUnity.Editor.Importer:ImportAssets(IAkyuiImportSettings, IAkyuiLoader, PathGetter, AkyuiLogger, IAkyuiProgress) (at Assets/AkyuiUnity/Editor/Importer.cs:191)
AkyuiUnity.Editor.Importer:Import(IAkyuiImportSettings, IAkyuiLoader, AkyuiLogger, IAkyuiProgress) (at Assets/AkyuiUnity/Editor/Importer.cs:87)
AkyuiUnity.Editor.Importer:Import(IAkyuiImportSettings, IAkyuiLoader[]) (at Assets/AkyuiUnity/Editor/Importer.cs:46)
AkyuiUnity.Xd.XdImporter:Import(XdImportSettings, String[]) (at Assets/AkyuiUnity.Xd/Editor/XdImporter.cs:45)
AkyuiUnity.Xd.XdImportSettingsEditor:OnInspectorGUI() (at Assets/AkyuiUnity.Xd/Editor/XdImportSettingsEditor.cs:38)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.