横竖版展示逻辑

This commit is contained in:
YiHan0621
2025-09-22 11:46:05 +08:00
parent 8ae9bbc7b1
commit 1aa3eef202
29 changed files with 254 additions and 38 deletions

View File

@@ -40,6 +40,9 @@ namespace TcgEngine
[Header("Dynamic Art Paths")]
public string art_full_path;
public string art_board_path;
public string art_horizontal_path;
public string art_vertical_path;
[Header("Stats")]
public CardType type;
@@ -127,6 +130,48 @@ namespace TcgEngine
return null;
}
public Sprite GetHorizontalArt()
{
if (!string.IsNullOrEmpty(art_horizontal_path))
{
Sprite dynamicSprite = SpriteLoader.Get()?.LoadSprite(art_horizontal_path);
if (dynamicSprite != null)
{
return dynamicSprite;
}
else
{
Debug.LogWarning($"卡牌{id} 图片加载失败: {art_horizontal_path}");
}
}
else
{
Debug.LogWarning($"卡牌{id} art_horizontal_path为空");
}
return null;
}
public Sprite GetVerticalArt()
{
if (!string.IsNullOrEmpty(art_vertical_path))
{
Sprite dynamicSprite = SpriteLoader.Get()?.LoadSprite(art_vertical_path);
if (dynamicSprite != null)
{
return dynamicSprite;
}
else
{
Debug.LogWarning($"卡牌{id} 图片加载失败: {art_vertical_path}");
}
}
else
{
Debug.LogWarning($"卡牌{id} art_vertical_path为空");
}
return null;
}
public string GetTitle()
{
return title;