GithubHelp home page GithubHelp logo

cdmvision / unity-figma-importer Goto Github PK

View Code? Open in Web Editor NEW
73.0 2.0 2.0 10.72 MB

Unity Figma Importer turns your Figma design into Unity UI elements and can bind codes with layout files to create Unity apps with ease.

License: MIT License

C# 86.47% ShaderLab 11.52% HLSL 2.00%

unity-figma-importer's Introduction

Unity Figma Importer

Transforming your Figma designs seamlessly into Unity UI elements is a breeze with the Unity Figma Importer. This powerful tool not only bridges the gap between design and development but also effortlessly binds codes with the layout files, empowering you to swiftly craft stunning Unity apps with precision and ease.

For enhanced functionality and seamless integration with Unity, it is recommended to use the Unity Figma Importer plugin with Figma app alongside this package.

Installation

Installing Unity Figma Importer Package

Unity Figma Importer - UGUI

Supported UI systems

  • Unity UI (UGUI)
  • UI Toolkit

Supported Figma Nodes

  • Page
  • Frame
  • Group
  • Instance
  • Component (as Instance)
  • Component Set (as Instance)
  • Text
  • Vector
  • Rectangle
  • Polygon
  • Star
  • Line
  • Ellipse
  • Boolean

Contribution

Unity Figma Importer is a fully open-source project, and we welcome contributions. Information on how to get started can be found in our contributor guide.

unity-figma-importer's People

Contributors

ibrahimpenekli avatar gunseliozkan avatar

Stargazers

nicabar avatar Roman Plotnikov avatar Jack avatar  avatar  avatar  avatar Louis avatar Furkan Emre YILMAZ avatar Dudu avatar Low Jiahao avatar Dezhemesov Makar avatar cosformula avatar João Vieira avatar Liam Knightley avatar Evgenii avatar  avatar Hideki Koike avatar Zombiemarx avatar Gökhan Yahya Torba avatar Arnol Robles Tintaya avatar yingnierxiao avatar MichaelO avatar Sergio Alejandro Ribera Costa avatar TimHubDevs avatar Mike Schweitzer avatar Batuhan Köroğlu avatar  avatar Loc Bui avatar Giovanni Giampiccolo avatar Jack Lumers avatar  avatar underdogg avatar Kim Hyeonwoo avatar  avatar Thành Long (WiIIiam) avatar  avatar Farley Drunk avatar Alexander Terekhov avatar Denis Cherkasov avatar Mefodei avatar Arda Erbaharlı avatar Ahmet Eren Özkılınç avatar  avatar Achil | Umut avatar  avatar Dima avatar Dachi Avkopashvili avatar Matías Mellado avatar Akshay Khandizod avatar Muhammet Fatih Aktaş avatar özkan yılmaz avatar Haikal Danung Trinanda avatar Alan Pereira Codes avatar M. Cihan Ozer avatar Nick avatar  avatar Nathan avatar  avatar Marlus Vinicius avatar ThanosRes avatar olidepalma avatar Hernan Perez avatar Guilherme Oliveira avatar Mert Kalkancı avatar Marcos Lazo avatar Vettorazi avatar Muhammet Furkan Küpçü avatar André de Miranda Cardoso avatar Akshay Kumar avatar Ke Jyun Wu avatar HHHHHHHHHHHHHHHHHHHHHCS avatar mika avatar  avatar

Watchers

 avatar  avatar

unity-figma-importer's Issues

Should we change `isRequired` to `optional`?

Binding with FigmaNodeAttribute, FigmaResourceAttribute and FigmaLocalizeAttribute, most of time we use isRequired = true. So what if we change isRequired to optional, and set its default value as optional = false? In this way, we dont need to write isRequired frequently.

@gunseliozkan ?

Binding key problem when parent figma node has more than one component of same type as child

Example:

First of all,
"Scrollview" component must have "Content" binding key to convert figma node to a Scrollview component.

Let's say Parent Frame has two scrollviews (as child in hierarchy) for two different jobs: JobA and JobB, each of them has Content binding key because they MUST have it in order to be a scrollview. While binding Parent Frame and assigning mono behavior to it, say we have a figma node with binding key "Content" and it is associated with JobA. Now, if JobB (scrollview figma node) is higher than JobA (scrollview figma node) in hierarchy, the Content of Parent Frame will be bound to JobB's Content.

How should we prevent that?

Import multicolor text characters

Figma returns colors for each characters in the text component if it has multiple color. So we can import them.

{
  "id": "86:14",
  "name": "Roboto Black Italic",
  "type": "TEXT",
  "scrollBehavior": "SCROLLS",
  "blendMode": "PASS_THROUGH",
  "absoluteBoundingBox": {
    "x": 563,
    "y": 464,
    "width": 140,
    "height": 28
  },
  "absoluteRenderBounds": {
    "x": 563.03515625,
    "y": 467.98828125,
    "width": 140.94140625,
    "height": 18.29296875
  },
  "constraints": {
    "vertical": "TOP",
    "horizontal": "LEFT"
  },
  "fills": [
    {
      "blendMode": "NORMAL",
      "type": "SOLID",
      "color": {
        "r": 0,
        "g": 0,
        "b": 0,
        "a": 1
      }
    }
  ],
  "strokes": [],
  "strokeWeight": 1,
  "strokeAlign": "OUTSIDE",
  "effects": [],
  "characters": "Roboto Black",
  "style": {
    "fontFamily": "Roboto",
    "fontPostScriptName": "Roboto-BlackItalic",
    "italic": true,
    "fontWeight": 900,
    "textAutoResize": "WIDTH_AND_HEIGHT",
    "fontSize": 24,
    "textAlignHorizontal": "LEFT",
    "textAlignVertical": "TOP",
    "letterSpacing": 0,
    "lineHeightPx": 28.125,
    "lineHeightPercent": 100,
    "lineHeightUnit": "INTRINSIC_%"
  },
  "layoutVersion": 3,
  "characterStyleOverrides": [
    68,
    68,
    68,
    68,
    68,
    68,
    68,
    40,
    40,
    40,
    40,
    40
  ],
  "styleOverrideTable": {
    "40": {
      "fills": [
        {
          "blendMode": "NORMAL",
          "type": "SOLID",
          "color": {
            "r": 0,
            "g": 0,
            "b": 0,
            "a": 1
          }
        },
        {
          "blendMode": "NORMAL",
          "type": "SOLID",
          "color": {
            "r": 1,
            "g": 0,
            "b": 0,
            "a": 1
          }
        }
      ]
    },
    "68": {
      "fills": [
        {
          "blendMode": "NORMAL",
          "type": "SOLID",
          "color": {
            "r": 0,
            "g": 0.039999961853027344,
            "b": 1,
            "a": 1
          }
        }
      ]
    }
  },
  "lineTypes": [
    "NONE"
  ],
  "lineIndentations": [
    0
  ]
}

Dont import text values for each variant if they are same

For example; button label has a text component and user might want to it change dynamically at runtime. So we should not touch text component for this use case.

Another use case is; a toggle with "on/off" text. This time we should import text characters for each variant to show "on" when toggle is on; "off" when toggle is off.

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.