Skip to content

Latest commit

 

History

History
90 lines (62 loc) · 2.68 KB

README.md

File metadata and controls

90 lines (62 loc) · 2.68 KB

Unity SpriteAtlas Generator

A simple rule-based sprite atlas generator. The generator create atlased by matching the rule pattern.

Table of Contents

Install Package

Install via Package Manager

Add to your project manifiest by path [%UnityProject%]/Packages/manifiest.json new Scope:

{
  "scopedRegistries": [
    {
      "name": "UniGame",
      "url": "http://packages.unigame.pro:4873/",
      "scopes": [
        "com.unigame",
        "com.littlebigfun",
        "com.alelievr"
      ]
    },
    
    "__comment":"another scoped registers",
    
  ],
}

Now install via Package Manager

Install via Git URL

Open Packages/manifest.json with your favorite text editor. Add the following line to the dependencies block.

    {
        "dependencies": {
            "com.unigame.atlasgenerator": "https://github.com/UniGameTeam/UniGame.AtlasGenerator.git"
        }
    }
    

How to Use

Default Sprite Atlas Settings

Atlas Generator Rules

  • Sprites Root Root folder for scaning all defined rules

  • Match Type

    • Wildcard, * matches any number of characters, ? matches a single character.
    • Regex.
  • Path, path or regexpr to files

  • Path to Altlas, location where generated atlases will be saved, support regexp groups

  • Apply Custom Settings, allow you override default atlas settings

Rule Examples

Type Example
Wildcard Asset/Sprites/Icons/*
Wildcard Asset/Sprites/Level??/*.asset
Regex ^Assets/Models/.*\.fbx
Regex Assets/Weapons/(?<prefix>(?<category>[^/]+)/(.*/)*)(?<asset>.*_Data.*\.asset)
Rule Path Rule Type Results Comments
Assets/t1 Wildcard t1 and t1/1.txt bad
Assets/t1/*.txt Wildcard t1/1.txt good
^Assets/t1$ Regex t1 good
^Assets/t1/.* Regex t1/1.txt good