Coder Social home page Coder Social logo

Comments (15)

KlingOne avatar KlingOne commented on August 14, 2024 1

With the updated plugin it works, thx!

Just sharing some of my observations:

  • The ComponentToPrefabSample only seems to work if the prefab is allready in Unity

    • If the prefab is not present it properly imports the prefab, but all prefab instances have the default values
    • If you then import it a second time without deleting the existing prefab in unity all changes get properly applied to the prefab instances
  • ToggleGroups do not work when they are part of a prefab

    • Convert the toggle {toggle-group: GroupA} Element into a prefab and then export it and import it to unity and you get a structure like this where every toggle has its own toggle group
      image

Apart from those 2 small issues it works great!

from xuidunity.

KlingOne avatar KlingOne commented on August 14, 2024 1

Thx for the quick fixes!

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

Challenge #129

  • Automated Prefab Variant generation
  • IDing the root name to retain the changes.
  • IDing the child object names may allow for more work to be retained.

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

Challenge #129

did not marge.

  • I want to keep the conversion simple.
  • ID-named files are difficult to manage.

from xuidunity.

KlingOne avatar KlingOne commented on August 14, 2024

Hi,

I just looked at the project again after a long time and saw that you implemented prefabs that can only change their size but nothing else (like text etc...).
Why is that?
As far as I remember also applying changes to prefab instances wasn't too complicated.
Otherwise the usefulness of prefabs will be quite limited since you couldn't reuse a button with a different text for example.

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

I came up with the idea of adding recursion to CreatePrefab.
I tried it, and I'm glad it seems to be working.
image

The brunch is here.
https://github.com/itouh2-i0plus/XuidUnity/tree/feature/create-nested-prefab

There are the following problems.

  • The conversion of the nested prefab has to be finished before the artboard's prefab can be converted.
  • Images that are unchanged from the main component are also converted.

There are some issues, but I like it because it was smartly done.
It might be able to handle more than just text/image changes from the main component.

from xuidunity.

KlingOne avatar KlingOne commented on August 14, 2024

Hi itouh2-i0plus,

thx for the detailed answer.

There are the following problems.

  • The conversion of the nested prefab has to be finished before the artboard's prefab can be converted.
  • Images that are unchanged from the main component are also converted.

These were exactly the problems I faced with my prefab variant implementation of nested prefabs.
But your approach seems more promising since it seems to work without the use of prefab variants

The brunch is here.
https://github.com/itouh2-i0plus/XuidUnity/tree/feature/create-nested-prefab

I tried the branch and it does not seem to work for me (the changed components still have the master values)
Do I need to do something special during export for it to work?

image

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

The AdobeXD plugin also needs to be updated.
The branch has been updated with code fixes and plug-ins packaged.
https://github.com/itouh2-i0plus/XuidUnity/tree/feature/create-nested-prefab/Release

The conversion of the nested prefab has to be finished before the artboard's prefab can be converted.

I'm going to output the dependencies with an exporter and sort the conversion order based on that.

Images that are unchanged from the main component are also converted.

This one is hard to do; it requires an extension to the AdobeXD-API.
If the Artbord prefab and Nested prefab are in the same folder, it's not a problem.

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

Thanks for trying it out.
I'm glad to hear it's becoming a good product!

The ComponentToPrefabSample only seems to work if the prefab is allready in Unity

Expoter is now giving out dependency information.
I believe I have been able to handle it, but I will verify it.

ToggleGroups do not work when they are part of a prefab

This has to be fixed.
We will find a better way for the converter.

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

ToggleGroups do not work when they are part of a prefab
I fixed this.
I took the approach of creating a group at runtime.

I created the same Artboard.
The RadioButton is set up to be prefab, and it is mass-produced with a repeat grid.
image

After conversion.
It does not work as a RadioButton in the Editor Mode.
image

AddComponent
https://github.com/itouh2-i0plus/XuidUnity/blob/feature/create-nested-prefab/Develop/UnityProject/Assets/I0plus/XuidUnity/Scripts/Runtime/ToggleToRadio.cs
image

ToggleGroup is created that will be shared at runtime.
image

from xuidunity.

KlingOne avatar KlingOne commented on August 14, 2024

@itouh2-i0plus it would also be nice if Prefab names in XD could contain more than one Subfolder depth.
Currently prefab names like this "Prefabs/UIComponents/patientMenuEntry" lead to a weird import behaviour where prefabs get created multiple times in different Folders.
I tried to look at it myselfe but the problem seems to be caused by the exporters main.js replaceToFileName function which replaces the second '/' with a '_'
Sadly my javascript and japanese reading skills are not the best so I quickly gave up trying to fix it myselfe.

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

Sorry about the difficulty reading JavaScript code...
To make the folder depth free, both JavaScript and C# modifications are required.
I think it's a necessary feature as well, I'll consider fixing it.

from xuidunity.

itouh2-i0plus avatar itouh2-i0plus commented on August 14, 2024

Subfolders can be deeper.

image

Here's the brunch.
https://github.com/itouh2-i0plus/XuidUnity/tree/fix/subfolder
To know the location of the relative path Nested prefab, I output a marker file in the Export root folder.

I think this has been a good feature.
User can make favorite folder structure.

Remaining task: Don't output image if it is the same prefab's image.
This is the hard part.

from xuidunity.

KlingOne avatar KlingOne commented on August 14, 2024

Remaining task: Don't output image if it is the same prefab's image.
This is the hard part.

Shouldn't this be quite easy on the unity side?
I saw that you are allready doing some sort of caching of the imported sprites so it should be easy do check if a sprite already exists.
And if a user deletes a sprite or prefab you could use something like this to detect the change and update sprite cache.

    {
        if (AssetDatabase.GetMainAssetTypeAtPath(path) == typeof(MyType))
        {
            if (AssetDatabase.TryGetGUIDAndLocalFileIdentifier(AssetDatabase.LoadAssetAtPath<MyType>(path), out var guid, out long id))
                //Delete Sprite from cache here
        }
        return AssetDeleteResult.DidNotDelete;
    }`

from xuidunity.

Related Issues (11)

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.