添加图片素材读取流程

This commit is contained in:
huangjun
2026-08-31 10:22:59 +08:00
parent 816335b894
commit fce331da84
42 changed files with 19608 additions and 4003 deletions
Binary file not shown.
@@ -11,7 +11,8 @@
"attackActionId": 1, "attackActionId": 1,
"skillActionId": 101, "skillActionId": 101,
"weaponItemId": 0, "weaponItemId": 0,
"armorItemId": 0 "armorItemId": 0,
"icon": "角色1"
}, },
{ {
"id": 1002, "id": 1002,
@@ -25,7 +26,8 @@
"attackActionId": 1, "attackActionId": 1,
"skillActionId": 102, "skillActionId": 102,
"weaponItemId": 0, "weaponItemId": 0,
"armorItemId": 0 "armorItemId": 0,
"icon": "角色2"
}, },
{ {
"id": 1003, "id": 1003,
@@ -39,7 +41,8 @@
"attackActionId": 1, "attackActionId": 1,
"skillActionId": 103, "skillActionId": 103,
"weaponItemId": 0, "weaponItemId": 0,
"armorItemId": 0 "armorItemId": 0,
"icon": "角色3"
}, },
{ {
"id": 1004, "id": 1004,
@@ -53,6 +56,7 @@
"attackActionId": 1, "attackActionId": 1,
"skillActionId": 104, "skillActionId": 104,
"weaponItemId": 0, "weaponItemId": 0,
"armorItemId": 0 "armorItemId": 0,
"icon": "角色4"
} }
] ]
Binary file not shown.
+20 -10
View File
@@ -10,7 +10,8 @@
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0, "matBonus": 0,
"speedBonus": 0 "speedBonus": 0,
"icon": "旧硬币"
}, },
{ {
"id": 5002, "id": 5002,
@@ -23,7 +24,8 @@
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0, "matBonus": 0,
"speedBonus": 0 "speedBonus": 0,
"icon": "宝石碎片"
}, },
{ {
"id": 5003, "id": 5003,
@@ -36,7 +38,8 @@
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0, "matBonus": 0,
"speedBonus": 0 "speedBonus": 0,
"icon": "古代零件"
}, },
{ {
"id": 5004, "id": 5004,
@@ -49,7 +52,8 @@
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0, "matBonus": 0,
"speedBonus": 0 "speedBonus": 0,
"icon": "精致核心"
}, },
{ {
"id": 5005, "id": 5005,
@@ -62,7 +66,8 @@
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0, "matBonus": 0,
"speedBonus": 0 "speedBonus": 0,
"icon": "神秘遗物"
}, },
{ {
"id": 5101, "id": 5101,
@@ -75,7 +80,8 @@
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 5, "atkBonus": 5,
"matBonus": 0, "matBonus": 0,
"speedBonus": 0 "speedBonus": 0,
"icon": "训练剑"
}, },
{ {
"id": 5102, "id": 5102,
@@ -88,7 +94,8 @@
"maxMpBonus": 10, "maxMpBonus": 10,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 8, "matBonus": 8,
"speedBonus": 0 "speedBonus": 0,
"icon": "法杖"
}, },
{ {
"id": 5201, "id": 5201,
@@ -101,7 +108,8 @@
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0, "matBonus": 0,
"speedBonus": 1 "speedBonus": 1,
"icon": "布甲"
}, },
{ {
"id": 5202, "id": 5202,
@@ -114,7 +122,8 @@
"maxMpBonus": 30, "maxMpBonus": 30,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 5, "matBonus": 5,
"speedBonus": 0 "speedBonus": 0,
"icon": "术士长袍"
}, },
{ {
"id": 5301, "id": 5301,
@@ -127,6 +136,7 @@
"maxMpBonus": 0, "maxMpBonus": 0,
"atkBonus": 0, "atkBonus": 0,
"matBonus": 0, "matBonus": 0,
"speedBonus": 0 "speedBonus": 0,
"icon": "恢复药"
} }
] ]
Binary file not shown.
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d32dc98febba844c4a6a2ea11a080ab0
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,72 @@
[
{
"key": "角色1",
"atlasPath": "Characters.png",
"spriteIndex": 0
},
{
"key": "角色2",
"atlasPath": "Characters.png",
"spriteIndex": 1
},
{
"key": "角色3",
"atlasPath": "Characters.png",
"spriteIndex": 2
},
{
"key": "角色4",
"atlasPath": "Characters.png",
"spriteIndex": 3
},
{
"key": "旧硬币",
"atlasPath": "Items.png",
"spriteIndex": 264
},
{
"key": "宝石碎片",
"atlasPath": "Items.png",
"spriteIndex": 275
},
{
"key": "古代零件",
"atlasPath": "Items.png",
"spriteIndex": 176
},
{
"key": "精致核心",
"atlasPath": "Items.png",
"spriteIndex": 238
},
{
"key": "神秘遗物",
"atlasPath": "Items.png",
"spriteIndex": 182
},
{
"key": "训练剑",
"atlasPath": "Items.png",
"spriteIndex": 0
},
{
"key": "法杖",
"atlasPath": "Items.png",
"spriteIndex": 110
},
{
"key": "布甲",
"atlasPath": "Items.png",
"spriteIndex": 132
},
{
"key": "术士长袍",
"atlasPath": "Items.png",
"spriteIndex": 134
},
{
"key": "恢复药",
"atlasPath": "Items.png",
"spriteIndex": 220
}
]
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2d73e9d921b1045bdb54123538528f06
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 8d68657bbcaf3164a9868d3041485557
folderAsset: yes
timeCreated: 1528026132
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -18,6 +18,7 @@ namespace SepCore.Definition
public const int DataTableAsset = 100; public const int DataTableAsset = 100;
public const int DictionaryAsset = 100; public const int DictionaryAsset = 100;
public const int FontAsset = 50; public const int FontAsset = 50;
public const int SpriteAsset = 40;
public const int MusicAsset = 20; public const int MusicAsset = 20;
public const int SceneAsset = 0; public const int SceneAsset = 0;
public const int SoundAsset = 30; public const int SoundAsset = 30;
@@ -28,6 +28,8 @@ public sealed partial class CharacterConfig : Luban.BeanBase
SkillActionId = _buf.ReadInt(); SkillActionId = _buf.ReadInt();
WeaponItemId = _buf.ReadInt(); WeaponItemId = _buf.ReadInt();
ArmorItemId = _buf.ReadInt(); ArmorItemId = _buf.ReadInt();
Icon = _buf.ReadString();
Icon_Ref = null;
} }
public static CharacterConfig DeserializeCharacterConfig(ByteBuf _buf) public static CharacterConfig DeserializeCharacterConfig(ByteBuf _buf)
@@ -83,6 +85,11 @@ public sealed partial class CharacterConfig : Luban.BeanBase
/// 初始防具ID,0为空 /// 初始防具ID,0为空
/// </summary> /// </summary>
public readonly int ArmorItemId; public readonly int ArmorItemId;
/// <summary>
/// 图标资源配置
/// </summary>
public readonly string Icon;
public SpriteConfig Icon_Ref;
public const int __ID__ = 676994987; public const int __ID__ = 676994987;
public override int GetTypeId() => __ID__; public override int GetTypeId() => __ID__;
@@ -101,6 +108,7 @@ public sealed partial class CharacterConfig : Luban.BeanBase
Icon_Ref = tables.TbSpriteConfig.GetOrDefault(Icon);
} }
public override string ToString() public override string ToString()
@@ -118,6 +126,7 @@ public sealed partial class CharacterConfig : Luban.BeanBase
+ "skillActionId:" + SkillActionId + "," + "skillActionId:" + SkillActionId + ","
+ "weaponItemId:" + WeaponItemId + "," + "weaponItemId:" + WeaponItemId + ","
+ "armorItemId:" + ArmorItemId + "," + "armorItemId:" + ArmorItemId + ","
+ "icon:" + Icon + ","
+ "}"; + "}";
} }
} }
@@ -27,6 +27,8 @@ public sealed partial class ItemConfig : Luban.BeanBase
AtkBonus = _buf.ReadInt(); AtkBonus = _buf.ReadInt();
MatBonus = _buf.ReadInt(); MatBonus = _buf.ReadInt();
SpeedBonus = _buf.ReadInt(); SpeedBonus = _buf.ReadInt();
Icon = _buf.ReadString();
Icon_Ref = null;
} }
public static ItemConfig DeserializeItemConfig(ByteBuf _buf) public static ItemConfig DeserializeItemConfig(ByteBuf _buf)
@@ -78,6 +80,11 @@ public sealed partial class ItemConfig : Luban.BeanBase
/// SPD修正 /// SPD修正
/// </summary> /// </summary>
public readonly int SpeedBonus; public readonly int SpeedBonus;
/// <summary>
/// 图标资源配置
/// </summary>
public readonly string Icon;
public SpriteConfig Icon_Ref;
public const int __ID__ = -764023723; public const int __ID__ = -764023723;
public override int GetTypeId() => __ID__; public override int GetTypeId() => __ID__;
@@ -95,6 +102,7 @@ public sealed partial class ItemConfig : Luban.BeanBase
Icon_Ref = tables.TbSpriteConfig.GetOrDefault(Icon);
} }
public override string ToString() public override string ToString()
@@ -111,6 +119,7 @@ public sealed partial class ItemConfig : Luban.BeanBase
+ "atkBonus:" + AtkBonus + "," + "atkBonus:" + AtkBonus + ","
+ "matBonus:" + MatBonus + "," + "matBonus:" + MatBonus + ","
+ "speedBonus:" + SpeedBonus + "," + "speedBonus:" + SpeedBonus + ","
+ "icon:" + Icon + ","
+ "}"; + "}";
} }
} }
@@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using Luban;
namespace SepCore.Definition
{
public sealed partial class SpriteConfig : Luban.BeanBase
{
public SpriteConfig(ByteBuf _buf)
{
Key = _buf.ReadString();
AtlasPath = _buf.ReadString();
SpriteIndex = _buf.ReadInt();
}
public static SpriteConfig DeserializeSpriteConfig(ByteBuf _buf)
{
return new SpriteConfig(_buf);
}
/// <summary>
/// 资源键
/// </summary>
public readonly string Key;
/// <summary>
/// 图集路径(相对于 Assets/GameMain/Textures)
/// </summary>
public readonly string AtlasPath;
/// <summary>
/// Sprite 索引(-1 表示整张图)
/// </summary>
public readonly int SpriteIndex;
public const int __ID__ = -1527849337;
public override int GetTypeId() => __ID__;
public void ResolveRef(Tables tables)
{
}
public override string ToString()
{
return "{ "
+ "key:" + Key + ","
+ "atlasPath:" + AtlasPath + ","
+ "spriteIndex:" + SpriteIndex + ","
+ "}";
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f3c1026f4da3a46e4af39d3feb237024
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -82,6 +82,10 @@ public partial class Tables
/// 界面音效配置 /// 界面音效配置
/// </summary> /// </summary>
public TbUISoundConfig TbUISoundConfig {get; } public TbUISoundConfig TbUISoundConfig {get; }
/// <summary>
/// 图片资源配置
/// </summary>
public TbSpriteConfig TbSpriteConfig {get; }
public Tables(System.Func<string, ByteBuf> loader) public Tables(System.Func<string, ByteBuf> loader)
{ {
@@ -103,6 +107,7 @@ public partial class Tables
TbSoundConfig = new TbSoundConfig(loader("tbsoundconfig")); TbSoundConfig = new TbSoundConfig(loader("tbsoundconfig"));
TbUIFormConfig = new TbUIFormConfig(loader("tbuiformconfig")); TbUIFormConfig = new TbUIFormConfig(loader("tbuiformconfig"));
TbUISoundConfig = new TbUISoundConfig(loader("tbuisoundconfig")); TbUISoundConfig = new TbUISoundConfig(loader("tbuisoundconfig"));
TbSpriteConfig = new TbSpriteConfig(loader("tbspriteconfig"));
ResolveRef(); ResolveRef();
} }
@@ -126,6 +131,7 @@ public partial class Tables
TbSoundConfig.ResolveRef(this); TbSoundConfig.ResolveRef(this);
TbUIFormConfig.ResolveRef(this); TbUIFormConfig.ResolveRef(this);
TbUISoundConfig.ResolveRef(this); TbUISoundConfig.ResolveRef(this);
TbSpriteConfig.ResolveRef(this);
} }
} }
@@ -0,0 +1,55 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using Luban;
namespace SepCore.Definition
{
/// <summary>
/// 图片资源配置
/// </summary>
public partial class TbSpriteConfig
{
private readonly System.Collections.Generic.Dictionary<string, SpriteConfig> _dataMap;
private readonly System.Collections.Generic.List<SpriteConfig> _dataList;
public TbSpriteConfig(ByteBuf _buf)
{
_dataMap = new System.Collections.Generic.Dictionary<string, SpriteConfig>();
_dataList = new System.Collections.Generic.List<SpriteConfig>();
for(int n = _buf.ReadSize() ; n > 0 ; --n)
{
SpriteConfig _v;
_v = SpriteConfig.DeserializeSpriteConfig(_buf);
_dataList.Add(_v);
_dataMap.Add(_v.Key, _v);
}
}
public System.Collections.Generic.Dictionary<string, SpriteConfig> DataMap => _dataMap;
public System.Collections.Generic.List<SpriteConfig> DataList => _dataList;
public SpriteConfig GetOrDefault(string key) => _dataMap.TryGetValue(key, out var v) ? v : null;
public SpriteConfig Get(string key) => _dataMap[key];
public SpriteConfig this[string key] => _dataMap[key];
public void ResolveRef(Tables tables)
{
foreach(var _v in _dataList)
{
_v.ResolveRef(tables);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 96ef8dd7c7cf44d7b8a3b64f80723105
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -61,5 +61,13 @@ namespace SepCore.Utility
{ {
return GameFramework.Utility.Text.Format("Assets/GameMain/UI/UISounds/{0}.wav", assetName); return GameFramework.Utility.Text.Format("Assets/GameMain/UI/UISounds/{0}.wav", assetName);
} }
/// <summary>
/// 获取图片资源路径,assetName 为相对 Assets/GameMain/Textures 的路径,需包含扩展名
/// </summary>
public static string GetSpriteAsset(string assetName)
{
return GameFramework.Utility.Text.Format("Assets/GameMain/Textures/{0}", assetName);
}
} }
} }
@@ -0,0 +1,178 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
using SepCore.Definition;
using SepCore.Utility;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace SepCore.AsyncTask
{
/// <summary>
/// 图集 Sprite 加载器,通过图集名 + 序号定位 Sprite。
/// 序号 -1 表示图集本身就是一张完整 Sprite,不需要切分。
/// </summary>
public static class SpriteLoader
{
private const float DefaultPixelsPerUnit = 32f;
private static readonly Dictionary<string, Texture2D> _textureCache = new();
private static readonly Dictionary<string, Task<Texture2D>> _loadingTextures = new();
private static readonly Dictionary<string, Dictionary<int, Sprite>> _spriteCache = new();
/// <summary>
/// 异步加载图集 Sprite
/// </summary>
/// <param name="config">Sprite 配置</param>
/// <param name="tileSize">切分块尺寸(像素),默认 32</param>
/// <param name="pixelsPerUnit">Sprite 像素单位比,默认 32</param>
/// <param name="timeout">超时时间(秒),0 表示不超时</param>
/// <returns>加载的 Sprite,失败时返回 null</returns>
public static UniTask<Sprite> LoadSpriteAsync(SpriteConfig config, int tileSize = 32,
float pixelsPerUnit = DefaultPixelsPerUnit, float timeout = 0f)
{
return LoadSpriteAsync(config.AtlasPath, config.SpriteIndex, tileSize, pixelsPerUnit, timeout);
}
/// <summary>
/// 异步加载图集 Sprite
/// </summary>
/// <param name="atlasName">图集名称(相对 Assets/GameMain/Textures 的路径,含扩展名,如 32rogues/monsters.png)</param>
/// <param name="index">序号,-1 表示整张图集作为一张 Sprite</param>
/// <param name="tileSize">切分块尺寸(像素),默认 32</param>
/// <param name="pixelsPerUnit">Sprite 像素单位比,默认 32</param>
/// <param name="timeout">超时时间(秒),0 表示不超时</param>
/// <returns>加载的 Sprite,失败时返回 null</returns>
public static async UniTask<Sprite> LoadSpriteAsync(string atlasName, int index, int tileSize = 32,
float pixelsPerUnit = DefaultPixelsPerUnit, float timeout = 0f)
{
Texture2D texture = await GetTextureAsync(atlasName, timeout);
if (texture == null)
{
return null;
}
int cacheKey = index < 0 ? -1 : index;
if (!_spriteCache.TryGetValue(atlasName, out Dictionary<int, Sprite> sprites))
{
sprites = new Dictionary<int, Sprite>();
_spriteCache[atlasName] = sprites;
}
if (sprites.TryGetValue(cacheKey, out Sprite cached))
{
return cached;
}
Sprite sprite = CreateSprite(texture, cacheKey, tileSize, pixelsPerUnit);
if (sprite != null)
{
sprites[cacheKey] = sprite;
}
return sprite;
}
/// <summary>
/// 释放指定图集的所有 Sprite 和纹理引用
/// </summary>
public static void Release(string atlasName)
{
if (_spriteCache.TryGetValue(atlasName, out Dictionary<int, Sprite> sprites))
{
foreach (Sprite sprite in sprites.Values)
{
if (sprite != null)
{
UnityEngine.Object.Destroy(sprite);
}
}
sprites.Clear();
_spriteCache.Remove(atlasName);
}
if (_textureCache.TryGetValue(atlasName, out Texture2D texture))
{
global::GameEntry.Resource.UnloadAsset(texture);
_textureCache.Remove(atlasName);
}
}
/// <summary>
/// 释放所有图集的 Sprite 和纹理引用
/// </summary>
public static void ReleaseAll()
{
List<string> atlasNames = new List<string>(_textureCache.Keys);
foreach (string atlasName in atlasNames)
{
Release(atlasName);
}
}
private static async UniTask<Texture2D> GetTextureAsync(string atlasName, float timeout)
{
if (_textureCache.TryGetValue(atlasName, out Texture2D cached))
{
return cached;
}
if (_loadingTextures.TryGetValue(atlasName, out Task<Texture2D> loading))
{
return await loading;
}
Task<Texture2D> task = LoadTextureAsync(atlasName, timeout).AsTask();
_loadingTextures[atlasName] = task;
try
{
Texture2D texture = await task;
if (texture != null)
{
_textureCache[atlasName] = texture;
}
return texture;
}
finally
{
_loadingTextures.Remove(atlasName);
}
}
private static async UniTask<Texture2D> LoadTextureAsync(string atlasName, float timeout)
{
try
{
return await global::GameEntry.Resource.LoadAssetAsync<Texture2D>(
AssetUtility.GetSpriteAsset(atlasName), Constant.AssetPriority.SpriteAsset, timeout: timeout);
}
catch (Exception e)
{
Log.Error("加载图集失败: {0}, error: {1}", atlasName, e);
return null;
}
}
private static Sprite CreateSprite(Texture2D texture, int index, int tileSize, float pixelsPerUnit)
{
if (index < 0)
{
return Sprite.Create(texture, new Rect(0f, 0f, texture.width, texture.height), new Vector2(0.5f, 0.5f), pixelsPerUnit);
}
int columns = Mathf.Max(1, texture.width / tileSize);
int rows = Mathf.Max(1, texture.height / tileSize);
int column = index % columns;
int row = index / columns;
if (row >= rows)
{
Log.Error("图集 {0} 序号 {1} 超出范围 (cols: {2}, rows: {3})", texture.name, index, columns, rows);
return null;
}
float x = column * tileSize;
float y = texture.height - (row + 1) * tileSize;
return Sprite.Create(texture, new Rect(x, y, tileSize, tileSize), new Vector2(0.5f, 0.5f), pixelsPerUnit);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b27858426f6b44b718b0279bdff6bc1e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -35,12 +35,14 @@ namespace SepCore.CustomComponent
"tbsoundconfig", "tbsoundconfig",
"tbuiformconfig", "tbuiformconfig",
"tbuisoundconfig", "tbuisoundconfig",
"tbformattext" "tbformattext",
"tbspriteconfig"
}; };
private sealed class TableAccessor private sealed class TableAccessor
{ {
public Func<Tables, int, object> RowGetter; public Func<Tables, int, object> RowGetter;
public Func<Tables, string, object> StringRowGetter;
public Func<Tables, object> ListGetter; public Func<Tables, object> ListGetter;
} }
@@ -127,6 +129,11 @@ namespace SepCore.CustomComponent
Accessor(tables => id => tables.TbUISoundConfig.GetOrDefault(id), Accessor(tables => id => tables.TbUISoundConfig.GetOrDefault(id),
tables => tables.TbUISoundConfig.DataList) tables => tables.TbUISoundConfig.DataList)
}, },
{
typeof(SpriteConfig),
StringAccessor(tables => key => tables.TbSpriteConfig.GetOrDefault(key),
tables => tables.TbSpriteConfig.DataList)
},
}; };
private static TableAccessor Accessor<TValue>(Func<Tables, Func<int, object>> rowGetterFactory, private static TableAccessor Accessor<TValue>(Func<Tables, Func<int, object>> rowGetterFactory,
@@ -139,6 +146,16 @@ namespace SepCore.CustomComponent
}; };
} }
private static TableAccessor StringAccessor<TValue>(Func<Tables, Func<string, object>> rowGetterFactory,
Func<Tables, List<TValue>> listGetter) where TValue : BeanBase
{
return new TableAccessor
{
StringRowGetter = (tables, key) => rowGetterFactory(tables)(key),
ListGetter = tables => listGetter(tables)
};
}
private Dictionary<string, byte[]> _tableBytes = null; private Dictionary<string, byte[]> _tableBytes = null;
private int _remainCount = 0; private int _remainCount = 0;
private Action _onLoadSuccess = null; private Action _onLoadSuccess = null;
@@ -178,6 +195,33 @@ namespace SepCore.CustomComponent
return (T)accessor.RowGetter(Tables, id); return (T)accessor.RowGetter(Tables, id);
} }
/// <summary>
/// 按字符串主键获取数据行,未找到时返回 null。
/// </summary>
/// <typeparam name="T">数据行类型(对应生成的 xxxConfig 类)。</typeparam>
/// <param name="key">数据行字符串主键。</param>
/// <returns>数据行,未找到时返回 null。</returns>
public T Get<T>(string key) where T : class
{
if (Tables == null)
{
throw new InvalidOperationException("Luban data tables are not loaded yet.");
}
TableAccessor accessor;
if (!TableAccessors.TryGetValue(typeof(T), out accessor))
{
throw new NotSupportedException("No table getter is registered for type '" + typeof(T).FullName + "'.");
}
if (accessor.StringRowGetter == null)
{
throw new NotSupportedException("Table for type '" + typeof(T).FullName + "' does not use a string key.");
}
return (T)accessor.StringRowGetter(Tables, key);
}
/// <summary> /// <summary>
/// 获取整个表的所有数据行。 /// 获取整个表的所有数据行。
/// </summary> /// </summary>
@@ -1,3 +1,5 @@
using Cysharp.Threading.Tasks;
using SepCore.AsyncTask;
using SepCore.Definition; using SepCore.Definition;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
@@ -17,6 +19,8 @@ namespace SepCore.UI
[SerializeField] private FormatTextUI atkText; [SerializeField] private FormatTextUI atkText;
[SerializeField] private FormatTextUI matText; [SerializeField] private FormatTextUI matText;
private int _iconVersion = 0;
/// <summary> /// <summary>
/// 用存档角色填充格子;角色配置不存在时按空格子显示。 /// 用存档角色填充格子;角色配置不存在时按空格子显示。
/// </summary> /// </summary>
@@ -36,7 +40,8 @@ namespace SepCore.UI
speedText.Set(config.Speed); speedText.Set(config.Speed);
atkText.Set(config.Atk); atkText.Set(config.Atk);
matText.Set(config.Mat); matText.Set(config.Mat);
HideIcon(); _iconVersion++;
ShowIconAsync(config.Icon_Ref, _iconVersion).Forget();
} }
/// <summary> /// <summary>
@@ -44,6 +49,7 @@ namespace SepCore.UI
/// </summary> /// </summary>
public void SetEmpty() public void SetEmpty()
{ {
_iconVersion++;
characterName.text = string.Empty; characterName.text = string.Empty;
hpText.Clear(); hpText.Clear();
mpText.Clear(); mpText.Clear();
@@ -63,5 +69,25 @@ namespace SepCore.UI
icon.sprite = null; icon.sprite = null;
icon.gameObject.SetActive(false); icon.gameObject.SetActive(false);
} }
/// <summary>
/// 异步加载角色图标;iconVersion 用于防止复用格子时旧加载结果覆盖新内容。
/// </summary>
private async UniTaskVoid ShowIconAsync(SpriteConfig iconConfig, int iconVersion)
{
if (iconConfig == null || icon == null)
{
return;
}
Sprite sprite = await SpriteLoader.LoadSpriteAsync(iconConfig);
if (sprite == null || _iconVersion != iconVersion)
{
return;
}
icon.sprite = sprite;
icon.gameObject.SetActive(true);
}
} }
} }
@@ -1,3 +1,5 @@
using Cysharp.Threading.Tasks;
using SepCore.AsyncTask;
using SepCore.Base; using SepCore.Base;
using SepCore.Definition; using SepCore.Definition;
using TMPro; using TMPro;
@@ -26,6 +28,7 @@ namespace SepCore.UI
private int _slotId = 0; private int _slotId = 0;
private bool _filled = false; private bool _filled = false;
private bool _clickBound = false; private bool _clickBound = false;
private int _iconVersion = 0;
/// <summary> /// <summary>
/// 设置格子在固定网格中的索引,点击事件以此作为唯一标识。 /// 设置格子在固定网格中的索引,点击事件以此作为唯一标识。
@@ -49,9 +52,10 @@ namespace SepCore.UI
} }
_filled = true; _filled = true;
_iconVersion++;
rarity.color = GetRarityColor(config.Rarity); rarity.color = GetRarityColor(config.Rarity);
quantityText.text = stack.count.ToString(); quantityText.text = stack.count.ToString();
HideIcon(); ShowIconAsync(config.Icon_Ref, _iconVersion).Forget();
BindClick(); BindClick();
if (button != null) if (button != null)
{ {
@@ -65,6 +69,7 @@ namespace SepCore.UI
public void SetEmpty() public void SetEmpty()
{ {
_filled = false; _filled = false;
_iconVersion++;
rarity.color = RarityEmpty; rarity.color = RarityEmpty;
quantityText.text = string.Empty; quantityText.text = string.Empty;
HideIcon(); HideIcon();
@@ -117,6 +122,26 @@ namespace SepCore.UI
icon.gameObject.SetActive(false); icon.gameObject.SetActive(false);
} }
/// <summary>
/// 异步加载物品图标;iconVersion 用于防止复用格子时旧加载结果覆盖新内容。
/// </summary>
private async UniTaskVoid ShowIconAsync(SpriteConfig iconConfig, int iconVersion)
{
if (iconConfig == null || icon == null)
{
return;
}
Sprite sprite = await SpriteLoader.LoadSpriteAsync(iconConfig);
if (sprite == null || _iconVersion != iconVersion)
{
return;
}
icon.sprite = sprite;
icon.gameObject.SetActive(true);
}
private static Color GetRarityColor(Rarity rarity) private static Color GetRarityColor(Rarity rarity)
{ {
switch (rarity) switch (rarity)
@@ -1,3 +1,5 @@
using Cysharp.Threading.Tasks;
using SepCore.AsyncTask;
using SepCore.Definition; using SepCore.Definition;
using UnityEngine; using UnityEngine;
using UnityGameFramework.Runtime; using UnityGameFramework.Runtime;
@@ -10,11 +12,14 @@ namespace SepCore.UI
/// </summary> /// </summary>
public partial class ItemDetailsForm : UGuiForm public partial class ItemDetailsForm : UGuiForm
{ {
private int _iconVersion = 0;
/// <summary> /// <summary>
/// 按物品 ID 刷新详情界面;配置不存在时清空显示。 /// 按物品 ID 刷新详情界面;配置不存在时清空显示。
/// </summary> /// </summary>
public void Refresh(int itemId) public void Refresh(int itemId)
{ {
_iconVersion++;
ItemDetailsView view = View; ItemDetailsView view = View;
if (view == null) if (view == null)
{ {
@@ -79,6 +84,8 @@ namespace SepCore.UI
{ {
view.itemDetailIcon.gameObject.SetActive(false); view.itemDetailIcon.gameObject.SetActive(false);
} }
ShowIconAsync(config.Icon_Ref, _iconVersion).Forget();
} }
private static void ClearDetails(ItemDetailsView view) private static void ClearDetails(ItemDetailsView view)
@@ -97,6 +104,31 @@ namespace SepCore.UI
{ {
view.itemDetailDescriptionText.text = string.Empty; view.itemDetailDescriptionText.text = string.Empty;
} }
if (view.itemDetailIcon != null)
{
view.itemDetailIcon.gameObject.SetActive(false);
}
}
/// <summary>
/// 异步加载物品图标;iconVersion 用于防止连续刷新时旧加载结果覆盖新内容。
/// </summary>
private async UniTaskVoid ShowIconAsync(SpriteConfig iconConfig, int iconVersion)
{
if (iconConfig == null || View == null || View.itemDetailIcon == null)
{
return;
}
Sprite sprite = await SpriteLoader.LoadSpriteAsync(iconConfig);
if (sprite == null || _iconVersion != iconVersion)
{
return;
}
View.itemDetailIcon.sprite = sprite;
View.itemDetailIcon.gameObject.SetActive(true);
} }
private static string GetItemTypeName(ItemType itemType) private static string GetItemTypeName(ItemType itemType)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -588,7 +588,7 @@ TextureImporter:
name: autotiles_22 name: autotiles_22
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 352 x: 320
y: 192 y: 192
width: 32 width: 32
height: 32 height: 32
@@ -609,8 +609,8 @@ TextureImporter:
name: autotiles_23 name: autotiles_23
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 352
y: 160 y: 192
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -630,7 +630,7 @@ TextureImporter:
name: autotiles_24 name: autotiles_24
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 0
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -651,7 +651,7 @@ TextureImporter:
name: autotiles_25 name: autotiles_25
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 32
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -672,7 +672,7 @@ TextureImporter:
name: autotiles_26 name: autotiles_26
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 64
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -693,7 +693,7 @@ TextureImporter:
name: autotiles_27 name: autotiles_27
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 96
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -714,7 +714,7 @@ TextureImporter:
name: autotiles_28 name: autotiles_28
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 128
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -735,7 +735,7 @@ TextureImporter:
name: autotiles_29 name: autotiles_29
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 192 x: 160
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -756,7 +756,7 @@ TextureImporter:
name: autotiles_30 name: autotiles_30
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 224 x: 192
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -777,7 +777,7 @@ TextureImporter:
name: autotiles_31 name: autotiles_31
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 256 x: 224
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -798,7 +798,7 @@ TextureImporter:
name: autotiles_32 name: autotiles_32
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 288 x: 256
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -819,7 +819,7 @@ TextureImporter:
name: autotiles_33 name: autotiles_33
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 320 x: 288
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -840,7 +840,7 @@ TextureImporter:
name: autotiles_34 name: autotiles_34
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 352 x: 320
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -861,8 +861,8 @@ TextureImporter:
name: autotiles_35 name: autotiles_35
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 352
y: 128 y: 160
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -882,7 +882,7 @@ TextureImporter:
name: autotiles_36 name: autotiles_36
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 0
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -903,7 +903,7 @@ TextureImporter:
name: autotiles_37 name: autotiles_37
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 32
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -924,7 +924,7 @@ TextureImporter:
name: autotiles_38 name: autotiles_38
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 64
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -945,7 +945,7 @@ TextureImporter:
name: autotiles_39 name: autotiles_39
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 96
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -966,7 +966,7 @@ TextureImporter:
name: autotiles_40 name: autotiles_40
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 128
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -987,7 +987,7 @@ TextureImporter:
name: autotiles_41 name: autotiles_41
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 192 x: 160
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -1008,7 +1008,7 @@ TextureImporter:
name: autotiles_42 name: autotiles_42
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 224 x: 192
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -1029,7 +1029,7 @@ TextureImporter:
name: autotiles_43 name: autotiles_43
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 256 x: 224
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -1050,7 +1050,7 @@ TextureImporter:
name: autotiles_44 name: autotiles_44
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 288 x: 256
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -1071,7 +1071,7 @@ TextureImporter:
name: autotiles_45 name: autotiles_45
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 320 x: 288
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -1092,7 +1092,7 @@ TextureImporter:
name: autotiles_46 name: autotiles_46
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 352 x: 320
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -1113,8 +1113,8 @@ TextureImporter:
name: autotiles_47 name: autotiles_47
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 352
y: 96 y: 128
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -1134,7 +1134,7 @@ TextureImporter:
name: autotiles_48 name: autotiles_48
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 0
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1155,7 +1155,7 @@ TextureImporter:
name: autotiles_49 name: autotiles_49
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 32
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1176,7 +1176,7 @@ TextureImporter:
name: autotiles_50 name: autotiles_50
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 64
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1197,7 +1197,7 @@ TextureImporter:
name: autotiles_51 name: autotiles_51
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 96
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1218,7 +1218,7 @@ TextureImporter:
name: autotiles_52 name: autotiles_52
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 128
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1239,7 +1239,7 @@ TextureImporter:
name: autotiles_53 name: autotiles_53
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 192 x: 160
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1260,7 +1260,7 @@ TextureImporter:
name: autotiles_54 name: autotiles_54
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 224 x: 192
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1281,7 +1281,7 @@ TextureImporter:
name: autotiles_55 name: autotiles_55
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 256 x: 224
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1302,7 +1302,7 @@ TextureImporter:
name: autotiles_56 name: autotiles_56
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 288 x: 256
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1323,7 +1323,7 @@ TextureImporter:
name: autotiles_57 name: autotiles_57
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 320 x: 288
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1344,7 +1344,7 @@ TextureImporter:
name: autotiles_58 name: autotiles_58
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 352 x: 320
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -1365,8 +1365,8 @@ TextureImporter:
name: autotiles_59 name: autotiles_59
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 352
y: 64 y: 96
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -1386,7 +1386,7 @@ TextureImporter:
name: autotiles_60 name: autotiles_60
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 0
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1407,7 +1407,7 @@ TextureImporter:
name: autotiles_61 name: autotiles_61
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 32
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1428,7 +1428,7 @@ TextureImporter:
name: autotiles_62 name: autotiles_62
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 64
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1449,7 +1449,7 @@ TextureImporter:
name: autotiles_63 name: autotiles_63
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 96
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1470,7 +1470,7 @@ TextureImporter:
name: autotiles_64 name: autotiles_64
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 128
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1491,7 +1491,7 @@ TextureImporter:
name: autotiles_65 name: autotiles_65
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 192 x: 160
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1512,7 +1512,7 @@ TextureImporter:
name: autotiles_66 name: autotiles_66
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 224 x: 192
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1533,7 +1533,7 @@ TextureImporter:
name: autotiles_67 name: autotiles_67
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 256 x: 224
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1554,7 +1554,7 @@ TextureImporter:
name: autotiles_68 name: autotiles_68
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 288 x: 256
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1575,7 +1575,7 @@ TextureImporter:
name: autotiles_69 name: autotiles_69
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 352 x: 288
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -1596,8 +1596,8 @@ TextureImporter:
name: autotiles_70 name: autotiles_70
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 320
y: 32 y: 64
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -1617,8 +1617,8 @@ TextureImporter:
name: autotiles_71 name: autotiles_71
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 352
y: 32 y: 64
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -1638,7 +1638,7 @@ TextureImporter:
name: autotiles_72 name: autotiles_72
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 0
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1659,7 +1659,7 @@ TextureImporter:
name: autotiles_73 name: autotiles_73
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 32
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1680,7 +1680,7 @@ TextureImporter:
name: autotiles_74 name: autotiles_74
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 64
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1701,7 +1701,7 @@ TextureImporter:
name: autotiles_75 name: autotiles_75
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 96
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1722,7 +1722,7 @@ TextureImporter:
name: autotiles_76 name: autotiles_76
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 192 x: 128
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1743,7 +1743,7 @@ TextureImporter:
name: autotiles_77 name: autotiles_77
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 224 x: 160
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1764,7 +1764,7 @@ TextureImporter:
name: autotiles_78 name: autotiles_78
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 256 x: 192
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1785,7 +1785,7 @@ TextureImporter:
name: autotiles_79 name: autotiles_79
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 288 x: 224
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1806,7 +1806,7 @@ TextureImporter:
name: autotiles_80 name: autotiles_80
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 320 x: 256
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1827,7 +1827,7 @@ TextureImporter:
name: autotiles_81 name: autotiles_81
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 352 x: 288
y: 32 y: 32
width: 32 width: 32
height: 32 height: 32
@@ -1848,8 +1848,8 @@ TextureImporter:
name: autotiles_82 name: autotiles_82
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 320
y: 0 y: 32
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -1869,8 +1869,8 @@ TextureImporter:
name: autotiles_83 name: autotiles_83
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 352
y: 0 y: 32
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -1890,7 +1890,7 @@ TextureImporter:
name: autotiles_84 name: autotiles_84
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 0
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -1911,7 +1911,7 @@ TextureImporter:
name: autotiles_85 name: autotiles_85
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 32
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -1932,7 +1932,7 @@ TextureImporter:
name: autotiles_86 name: autotiles_86
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 64
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -1953,7 +1953,7 @@ TextureImporter:
name: autotiles_87 name: autotiles_87
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 96
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -1974,7 +1974,7 @@ TextureImporter:
name: autotiles_88 name: autotiles_88
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 192 x: 128
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -1995,7 +1995,7 @@ TextureImporter:
name: autotiles_89 name: autotiles_89
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 224 x: 160
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -2016,7 +2016,7 @@ TextureImporter:
name: autotiles_90 name: autotiles_90
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 256 x: 192
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -2037,7 +2037,7 @@ TextureImporter:
name: autotiles_91 name: autotiles_91
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 288 x: 224
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -2058,7 +2058,7 @@ TextureImporter:
name: autotiles_92 name: autotiles_92
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 320 x: 256
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -2079,7 +2079,7 @@ TextureImporter:
name: autotiles_93 name: autotiles_93
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 352 x: 288
y: 0 y: 0
width: 32 width: 32
height: 32 height: 32
@@ -2096,6 +2096,48 @@ TextureImporter:
indices: indices:
edges: [] edges: []
weights: [] weights: []
- serializedVersion: 2
name: autotiles_94
rect:
serializedVersion: 2
x: 320
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 8f3e8f32ec8214bdb92060105fc2c831
internalID: 139804532
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: autotiles_95
rect:
serializedVersion: 2
x: 352
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 0c0061e5075b14bd8905042f924edb85
internalID: -132204191
vertices: []
indices:
edges: []
weights: []
outline: [] outline: []
physicsShape: [] physicsShape: []
bones: [] bones: []
@@ -2201,6 +2243,8 @@ TextureImporter:
autotiles_91: -919255568 autotiles_91: -919255568
autotiles_92: -797383252 autotiles_92: -797383252
autotiles_93: -1781644614 autotiles_93: -1781644614
autotiles_94: 139804532
autotiles_95: -132204191
mipmapLimitGroupName: mipmapLimitGroupName:
pSDRemoveMatte: 0 pSDRemoveMatte: 0
userData: userData:
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

@@ -231,8 +231,8 @@ TextureImporter:
name: rogues_5 name: rogues_5
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 160
y: 160 y: 192
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -252,8 +252,8 @@ TextureImporter:
name: rogues_6 name: rogues_6
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 192
y: 160 y: 192
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -273,7 +273,7 @@ TextureImporter:
name: rogues_7 name: rogues_7
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 0
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -294,7 +294,7 @@ TextureImporter:
name: rogues_8 name: rogues_8
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 32
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -315,7 +315,7 @@ TextureImporter:
name: rogues_9 name: rogues_9
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 64
y: 160 y: 160
width: 32 width: 32
height: 32 height: 32
@@ -336,8 +336,8 @@ TextureImporter:
name: rogues_10 name: rogues_10
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 96
y: 128 y: 160
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -357,8 +357,8 @@ TextureImporter:
name: rogues_11 name: rogues_11
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 128
y: 128 y: 160
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -378,8 +378,8 @@ TextureImporter:
name: rogues_12 name: rogues_12
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 160
y: 128 y: 160
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -399,8 +399,8 @@ TextureImporter:
name: rogues_13 name: rogues_13
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 192
y: 128 y: 160
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -420,7 +420,7 @@ TextureImporter:
name: rogues_14 name: rogues_14
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 0
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -441,7 +441,7 @@ TextureImporter:
name: rogues_15 name: rogues_15
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 32
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -462,7 +462,7 @@ TextureImporter:
name: rogues_16 name: rogues_16
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 192 x: 64
y: 128 y: 128
width: 32 width: 32
height: 32 height: 32
@@ -483,8 +483,8 @@ TextureImporter:
name: rogues_17 name: rogues_17
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 96
y: 96 y: 128
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -504,8 +504,8 @@ TextureImporter:
name: rogues_18 name: rogues_18
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 128
y: 96 y: 128
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -525,8 +525,8 @@ TextureImporter:
name: rogues_19 name: rogues_19
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 160
y: 96 y: 128
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -546,8 +546,8 @@ TextureImporter:
name: rogues_20 name: rogues_20
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 192
y: 96 y: 128
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -567,7 +567,7 @@ TextureImporter:
name: rogues_21 name: rogues_21
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 0
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -588,7 +588,7 @@ TextureImporter:
name: rogues_22 name: rogues_22
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 32
y: 96 y: 96
width: 32 width: 32
height: 32 height: 32
@@ -609,8 +609,8 @@ TextureImporter:
name: rogues_23 name: rogues_23
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 64
y: 64 y: 96
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -630,8 +630,8 @@ TextureImporter:
name: rogues_24 name: rogues_24
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 96
y: 64 y: 96
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -651,8 +651,8 @@ TextureImporter:
name: rogues_25 name: rogues_25
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 128
y: 64 y: 96
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -672,8 +672,8 @@ TextureImporter:
name: rogues_26 name: rogues_26
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 160
y: 64 y: 96
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -693,8 +693,8 @@ TextureImporter:
name: rogues_27 name: rogues_27
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 192
y: 64 y: 96
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -714,7 +714,7 @@ TextureImporter:
name: rogues_28 name: rogues_28
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 0
y: 64 y: 64
width: 32 width: 32
height: 32 height: 32
@@ -735,8 +735,8 @@ TextureImporter:
name: rogues_29 name: rogues_29
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 32
y: 32 y: 64
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -756,8 +756,8 @@ TextureImporter:
name: rogues_30 name: rogues_30
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 64
y: 32 y: 64
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -777,8 +777,8 @@ TextureImporter:
name: rogues_31 name: rogues_31
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 96
y: 32 y: 64
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -798,8 +798,8 @@ TextureImporter:
name: rogues_32 name: rogues_32
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 128
y: 32 y: 64
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -819,8 +819,8 @@ TextureImporter:
name: rogues_33 name: rogues_33
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 160
y: 32 y: 64
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -840,8 +840,8 @@ TextureImporter:
name: rogues_34 name: rogues_34
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 160 x: 192
y: 32 y: 64
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -862,7 +862,7 @@ TextureImporter:
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 0 y: 32
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -883,7 +883,7 @@ TextureImporter:
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 32 x: 32
y: 0 y: 32
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -904,7 +904,7 @@ TextureImporter:
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 64 x: 64
y: 0 y: 32
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -925,7 +925,7 @@ TextureImporter:
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 96 x: 96
y: 0 y: 32
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -946,7 +946,7 @@ TextureImporter:
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 128 x: 128
y: 0 y: 32
width: 32 width: 32
height: 32 height: 32
alignment: 0 alignment: 0
@@ -962,6 +962,195 @@ TextureImporter:
indices: indices:
edges: [] edges: []
weights: [] weights: []
- serializedVersion: 2
name: rogues_40
rect:
serializedVersion: 2
x: 160
y: 32
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 9dc77ad50c57d4ee6a00d02537fea671
internalID: -1917637240
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: rogues_41
rect:
serializedVersion: 2
x: 192
y: 32
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 6eabea64129754dbb9402231aab117a8
internalID: 2117134290
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: rogues_42
rect:
serializedVersion: 2
x: 0
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 51d729838650041b5869b82d67f7960d
internalID: 393383766
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: rogues_43
rect:
serializedVersion: 2
x: 32
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 1ec0c2233b92c47ad8d0af1960754aa9
internalID: -251761591
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: rogues_44
rect:
serializedVersion: 2
x: 64
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: eec4a1f769cac47299eddbc2f164bb24
internalID: 55273946
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: rogues_45
rect:
serializedVersion: 2
x: 96
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 232182ca68b1c4c6ea0a2ce40461d3ea
internalID: 425358794
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: rogues_46
rect:
serializedVersion: 2
x: 128
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 88fce9116947647659688ae1fb0efacf
internalID: 1590564456
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: rogues_47
rect:
serializedVersion: 2
x: 160
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 634f6b5dee85e4fd286e79334572413d
internalID: 1587879998
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: rogues_48
rect:
serializedVersion: 2
x: 192
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 5a62b9770e66c4ae580e53347da77f0f
internalID: -639973697
vertices: []
indices:
edges: []
weights: []
outline: [] outline: []
physicsShape: [] physicsShape: []
bones: [] bones: []
@@ -1008,6 +1197,15 @@ TextureImporter:
rogues_38: -1914401805 rogues_38: -1914401805
rogues_39: -196351770 rogues_39: -196351770
rogues_4: 1329153914 rogues_4: 1329153914
rogues_40: -1917637240
rogues_41: 2117134290
rogues_42: 393383766
rogues_43: -251761591
rogues_44: 55273946
rogues_45: 425358794
rogues_46: 1590564456
rogues_47: 1587879998
rogues_48: -639973697
rogues_5: 629075895 rogues_5: 629075895
rogues_6: 1295761824 rogues_6: 1295761824
rogues_7: -1685225826 rogues_7: -1685225826

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@@ -341,10 +341,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 5163393369251416990} m_Father: {fileID: 5163393369251416990}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 112, y: 112} m_SizeDelta: {x: -32, y: -32}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8075368645370436796 --- !u!222 &8075368645370436796
CanvasRenderer: CanvasRenderer:
@@ -252,7 +252,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -2} m_AnchoredPosition: {x: 0, y: -2}
m_SizeDelta: {x: 100, y: 100} m_SizeDelta: {x: 128, y: 128}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1400271530215404024 --- !u!222 &1400271530215404024
CanvasRenderer: CanvasRenderer:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -4,7 +4,7 @@ set -euo pipefail
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
PROJECT_ROOT=$(cd "$SCRIPT_DIR/.." && pwd) PROJECT_ROOT=$(cd "$SCRIPT_DIR/.." && pwd)
ASSET_ROOT="$PROJECT_ROOT/Assets" ASSET_ROOT="$PROJECT_ROOT/Assets/GameMain/Textures"
PATH_FILE="$SCRIPT_DIR/path.txt" PATH_FILE="$SCRIPT_DIR/path.txt"
LUBAN_DLL="$SCRIPT_DIR/Tools/Luban/Luban.dll" LUBAN_DLL="$SCRIPT_DIR/Tools/Luban/Luban.dll"
CONF_FILE="$SCRIPT_DIR/luban.conf" CONF_FILE="$SCRIPT_DIR/luban.conf"