如果在 atals 中找不到 uisprite spriteName,我想显示另一个 spritename,我该怎么办?请给我一些建议,谢谢!
string aSpriteName = GetIconFromAtlas("item_005");
mTreasure2.transform.FindChild("item/ax/prize1").gameObject.GetComponent<UISprite>().spriteName =aSpriteName;
string GetIconFromAtlas(string spriteName)
{
string aSpriteName = spriteName;
if (string.IsNullOrEmpty(aSpriteName))
aSpriteName = "item000";
return aSpriteName;
}