横竖版展示逻辑
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user