123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using UnityEditor;
- using UnityEditor.Presets;
- namespace XGame.Editor.Asset
- {
- [Serializable]
- public class AtlasInfo
- {
- internal static AtlasInfo DefaultInfo()
- {
- return new AtlasInfo()
- {
- packerMode = SpritePackerMode.Atlas,
- atlasLayerLimit = 3,
- spriteAtlasPreset = DefaultPreset,
- };
- }
- public SpritePackerMode packerMode;
- /// <summary>
- /// 图集文件夹子目录的遍历上限
- /// 超过上限的视为同一个图集
- /// </summary>
- public byte atlasLayerLimit;
- /// <summary>
- /// 图集预设
- /// </summary>
- public Preset spriteAtlasPreset;
- /// <summary>
- /// 图集名命名类型
- /// 0:tag+文件夹名
- /// 1:文件夹路径
- /// 2:guid
- /// </summary>
- public int atlasNameType;
- private static Preset DefaultPreset
- {
- get
- {
- var guids = AssetDatabase.FindAssets("SpriteAtlasTemplate");
- if (guids.Length > 0)
- {
- var assetPath = AssetDatabase.GUIDToAssetPath(guids[0]);
- return AssetDatabase.LoadAssetAtPath<Preset>(assetPath);
- }
- return null;
- }
- }
- }
- }
|