当前位置: 首页 > news >正文

【Unity实用插件】SpriteDicing 2.1.0 中文文档

SpriteDicing has a Unity integration with full-fledged atlas editor. It communicates with the Rust libraries via C ABI and outputs native Unity sprite assets.

The extension package bundles pre-built binaries for Windows x64, Mac ARM and Linux x64. All the code is editor-only, so this covers all the Unity editor-supported platforms.

Minimum supported Unity version: 2022.3. For previous Unity versions use legacy v1.x branch: https://github.com/elringus/sprite-dicing/tree/arch/v1.

安装

使用 Unity 包管理器 将该包作为远程 git 包安装,要使用的 URI 如下:

https://github.com/elringus/sprite-dicing.git?path=/plugins/unity/Assets/SpriteDicing

替代方案:也可以克隆仓库并安装 扩展目录 作为本地包。

使用方法

  1. 使用Assets -> Create -> Diced Sprite Atlas菜单选项创建DicedSpriteAtlas资源,并选中它;
  2. 指定Input Folder — 项目目录,包含要处理的源纹理。您可以从项目层级窗口拖放文件夹,或使用对象选择器选择一个文件夹;
  3. 点击Build Atlas按钮,并等待过程完成;
  4. 生成的精灵图会出现在 atlas 资产中;像普通精灵图一样将它们拖放到场景中。

Atlas Generation Options

You can optionally configure atlas generation settings via the editor inspector window.

Option Description
Decouple Sprite Data Whether to save sprite assets in a separate folder instead of adding them as childs of the atlas asset.
Trim Transparent Whether to discard fully-transparent diced units on the generated mesh. Disable to preserve original texture dimensions (usable for animations).
Default Pivot Relative pivot point position in 0 to 1 range, counting from the bottom-left corner. Can be changed after build for each sprite individually.
Keep Original Whether to use pivot set on source textures (if any) instead of default.
Atlas Size Limit Maximum size of a single generated atlas texture; will generate multiple textures when the limit is reached.
Square The generated atlas textures will always be square. Less efficient, but required for PVRTC compression.
POT The generated atlas textures will always have width and height of power of two. Extremely inefficient, but may be required by some older GPUs.
Pixels Per Unit How many pixels in the sprite correspond to the unit in the world.
Dice Unit Size The size of a single diced unit.
Padding The size of a pixel border to add between adjacent diced units inside atlas. Increase to prevent texture bleeding artifacts (usually appear as thin gaps between diced units). Larger values will consume more texture space, but yield better anti-bleeding results. Minimum value of 2 is recommended in most cases. When 2 is not enough to prevent bleeding, consider adding a bit of UV Inset before increasing the padding.
UV Inset Relative inset of the diced units UV coordinates. Can be used in addition to (or instead of) Padding to prevent texture bleeding artifacts. Won't consume any texture space, but higher values could visually distort the final result.
Input Folder Asset folder with source sprite textures.
Include Subfolders Whether to recursively search for textures inside the input folder.
Separator When sprite is from a sub-folder(s), the separator will be used to join the folder name(s) and the sprite name.

All the above descriptions are available as tooltips when hovering corresponding configuration options in the editor.

Compression Ratio

When inspecting atlas asset, notice Compression Ratio line; it shows the ratio between source textures size and generated data (atlas textures + sprite meshes).

When close to 1 or lower, the value will be in yellow/red color indicating the generated data size is close to or even larger than the source and you should either change atlas generation configuration (eg, increase dice unit size) or not use the solution at all.

uGUI

To use the diced sprites in with Unity UI (aka uGUI), enable Use Sprite Mesh. In case the option is not available, make sure to assign a source image.

UI Toolkit

Diced sprites are normal Unity sprite assets and can be assigned as source for various visual UI Toolkit elements, no additional setup is required. Check "UI" scene in the samples directory for an example.

动画

It's possible to use diced sprites for animation. Make sure to disable Trim Transparent when generating the atlas to preserve relative positions of the generated sprites. An example on animating diced sprites is available in "Animation" scene.

http://www.zskr.cn/news/143396.html

相关文章:

  • 大模型开发避坑指南:医学RAG技术全面失效,专家揭示4大致命问题,开发者必看!
  • 2.1 变量与数据类型
  • 为什么闪回数据库后,必须用alter database open resetlogs;而不是普通的alter database open;
  • Java毕设项目推荐-基于springboot的传媒公司传媒直播直播运营管理系统设计与实现【附源码+文档,调试定制服务】
  • 突破井下数据存储瓶颈:超200℃存储芯片技术助力油气勘探迈向更深地层
  • 神经网络基础【笔记向】
  • 计算机毕业设计springboot教研室管理系统设计与实现 基于Spring Boot的高校教研室信息化管理系统开发与应用 Spring Boot框架下教研室综合管理平台的设计与实现
  • 《斯坦福CS336》作业开源,含讲解视频,带你从0手搓大模型|硬核教程
  • CAGR2.9%,全球石英波片市场稳步扩张,中国市场增速领跑
  • Check Point 156-215.81 認證考試介紹|Fortinet FortiGate 管理員認證
  • 程序员的魔术:变量交换的艺术与哲学
  • 计算机Java毕设实战-基vue的闲置物品循环交易保障系统的设计与基于SpringBoot的闲置物品循环交易保障系统的设计与实现【完整源码+LW+部署说明+演示视频,全bao一条龙等】
  • HarmonyOS 5开发从入门到精通(十七):新闻阅读应用实战(上)
  • 刚入门AI大模型?这6个GitHub教程,连微软都忍不住推荐
  • 大模型(Qwen3)训练实战:从零开始玩转LLaMA-Factory
  • Python中的文件操作详解
  • 毕设成品 stm32的火灾监控与可视化系统(源码+硬件+论文)
  • 基于SpringBoot的冷链运输生鲜销售系统计算机毕业设计项目源码文档
  • 12/23
  • 什么是智能问数
  • LLM之Agent完全指南:从零构建AI Agents的7大核心类型与实战代码!
  • 一张Transformer-LSTM模型的结构图
  • 稀疏注意力机制
  • 【技术美术】渲染空间变换概述
  • 疆鸿智能PROFIBUS联RS232:破解汽车智造追溯瓶颈,效率怒增!
  • Java毕设选题推荐:基于springboot+vue的社区资源共享系统设计与实现社区公共资源(活动室、工具房),实现在线预约与使用登记【附源码、mysql、文档、调试+代码讲解+全bao等】
  • 【软件开发】设计模式个人解读
  • 前端工程化核心面试题与详解
  • 【技术美术】光照技术概述
  • HarmonyOS 5开发从入门到精通(十四):待办事项应用实战(下)