立绘资源改动

main
Yuntao Hu 2024-09-14 15:01:28 +08:00
parent 12a3da4763
commit 2c1d5819dd
2 changed files with 25 additions and 6 deletions

View File

@ -145,7 +145,7 @@ public class ItemObj : UIGameObjectWrapper
}
private void RefreshDetail()
private async void RefreshDetail()
{
CommonUtils.GetGameObject(_itemGo, "test2").SetActive(_type == UIType.mail);
CommonUtils.GetGameObject(_itemGo, "test1").SetActive(_type == UIType.cultivate);
@ -158,7 +158,9 @@ public class ItemObj : UIGameObjectWrapper
CommonUtils.GetGameObject(_itemGo, "DebugID").SetActive(DisplayIDForCeHua.IsDisplayID);
CommonUtils.GetComponent<TMP_Text>(_itemGo, "DebugID").text = _Id.ToString();
OnIconLoaded();
_itemGo.gameObject.SetActive(false);
await OnIconLoaded();
_itemGo.gameObject.SetActive(true);
}
private void InitData(int itemId, GameObject paObj, int itemCount = 0)
{
@ -183,10 +185,11 @@ public class ItemObj : UIGameObjectWrapper
//下面写物品默认点击事件
}
private async void OnIconLoaded()
private async UniTask OnIconLoaded()
{
var spritePath = CommonUtils.GetItemPath(_Id);
CommonUtils.GetComponent<Image>(_itemGo, string.Format("test{0}/icon", (int)_type + 1)).sprite = await LoadAssetAsync<Sprite>(spritePath);
var img = CommonUtils.GetComponent<Image>(_itemGo, string.Format("test{0}/icon", (int)_type + 1));
img.sprite = await LoadAssetAsync<Sprite>(spritePath);
}
#endregion
}

View File

@ -244,9 +244,25 @@ namespace Gameplay
switch (eCharacterPicPathType)
{
case ECharacterPicPathType.Cultivate:
return @"Assets/Art/UI/Texture/UI_Pic_Main/UI_Poster/Cutivate/" + postCfg.Get(1, id).Cultivate + ".png";
name = postCfg.Get(1, id).Cultivate;
split = name.Split('_');
if (split[1].Equals("Cul"))
{
DebugUtil.Log("该角色使用旧版立绘资源配置:" + id);
return @"Assets/Art/UI/Texture/UI_Pic_Main/UI_Poster/Cutivate/" + postCfg.Get(1, id).Cultivate + ".png";
}
else
return Constants.UI_POSTER_DEFAULT_PATH + postCfg.Get(1, id).Cultivate + ".png";
case ECharacterPicPathType.Favorable:
return @"Assets/Art/UI/Texture/UI_Pic_Main/UI_Poster/Favorate/" + postCfg.Get(1, id).Favorable + ".png";
name = postCfg.Get(1, id).Favorable;
split = name.Split('_');
if (split[1].Equals("Fa"))
{
DebugUtil.Log("该角色使用旧版立绘资源配置:" + id);
return @"Assets/Art/UI/Texture/UI_Pic_Main/UI_Poster/Favorate/" + postCfg.Get(1, id).Favorable + ".png";
}
else
return Constants.UI_POSTER_DEFAULT_PATH + postCfg.Get(1, id).Favorable + ".png";
case ECharacterPicPathType.LevelUp:
name = postCfg.Get(1, id).LevelUp;
split = name.Split('_');