最终效果 前言 在这一集中我将使用Unity制作基于瓦片的网格库存系统。 就像在《逃离塔科夫》、《暗黑破坏神》或《流放之路》等游戏中一样。 素材下载 https://assetstore.unity.com/packages/2d/gui/icons/gui-parts-159068 图片配置 配置图片为重复 不懂UI画布适配查看:【Unity小技巧】最简单的UI设置适配方案 修改UI画布适配 新增UI图片,类型改为平铺,默认图片是256的,太大了,所以我们选择缩小4倍,每单位像素为4,同时注意修改轴心在左上角 获取格子坐标 新增ItemGrid代码 public class ItemGrid : MonoBehaviour { const float tileSizeWidth = 256 / 4; const float tileSizeHeight = 256 / 4; Vector2 positionOnTheGrid = new Vector2(); Vector2Int tileGridPosition = new Vector2Int();...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Clean
Contact Clean, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack