1、大图导入unity,修改配置
Texture Type:Sprite(2D and UI)
Sprite Mode:Multiple
Read/Write enabled:true
format:RGBA 32 bit
脚本如下:
using UnityEngine;
using UnityEditor;
public class Tools
{
[MenuItem("Tools/AtlasToSprite")]
public static void AtlasToSprite()
{
string out_path = "E:/Program/outSprite/";//图集最后输出路径
string resourcesPath = "Assets/Resources/";//因为使用的是Resources.LoadAll加载只能放这个目录下
Object[] selects = Selection.objects;
if(selects.Length < 1)
{
Debug.LogError("未选中文件");
return;
&nb