Skip to content

[BUG] Component with masks #56

@matfabry

Description

@matfabry

Describe the bug

When a component contains masks, the hierarchy in Unity gets an extra level (because in Unity the masking object needs to be the parent of masked objects).
This is causing an issue if any of the masked object need to be changed in the instance. The plugin fails to find those objects because they hide a level deeper in the hierarchy.

To Reproduce

Steps to reproduce the behaviour:

  1. Create a component with a rectangle masking a text object
  2. Create an instance of the component
  3. Change the text and colour of the text object in the instance
  4. Import to Unity

Expected behaviour
The importer could look into the masking objects when looking for objects to apply properties.

Log
Applying properties - Could not find child object I15:125;12:497 name bcg from parent node id I15:125;15:334 in parent transform background
UnityEngine.Debug:Log (object)
UnityFigmaBridge.Editor.Components.ComponentManager:ApplyFigmaProperties (UnityFigmaBridge.Editor.FigmaApi.Node,UnityEngine.GameObject,UnityFigmaBridge.Editor.FigmaApi.Node,UnityFigmaBridge.Editor.FigmaImportProcessData) (at ./Library/PackageCache/com.simonoliver.unityfigma@9bc41a73c7/UnityFigmaBridge/Editor/Components/ComponentManager.cs:266)

** Version**

  • Unity 2022.3
  • Platform macOS
  • URP

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions