Comments (15)
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
Apart from those 2 small issues it works great!
from xuidunity.
Thx for the quick fixes!
from xuidunity.
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.
Challenge #129
did not marge.
- I want to keep the conversion simple.
- ID-named files are difficult to manage.
from xuidunity.
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.
from xuidunity.
I came up with the idea of adding recursion to CreatePrefab.
I tried it, and I'm glad it seems to be working.
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.
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?
from xuidunity.
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.
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.
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.
After conversion.
It does not work as a RadioButton in the Editor Mode.
AddComponent
https://github.com/itouh2-i0plus/XuidUnity/blob/feature/create-nested-prefab/Develop/UnityProject/Assets/I0plus/XuidUnity/Scripts/Runtime/ToggleToRadio.cs
ToggleGroup is created that will be shared at runtime.
from xuidunity.
@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.
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.
Subfolders can be deeper.
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.
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)
- XdUnityUIExport.xdx is not updated. HOT 1
- XD-Component status is not currently supported? HOT 1
- Can't import the package HOT 4
- Art boards starts with the same name and space are merged on export HOT 2
- Order of .content elements in scrollgroup is wrong HOT 2
- where is import folder,i can not find. HOT 1
- Image importer is importing images in bad quality of image... HOT 7
- "Cannot select node outside the current edit context's scope" error HOT 1
- Missing an assembly reference
- Text Import Issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xuidunity.