예제 #1
0
    public static Sprite LoadGameIcon(string name, GameLevelRewardType rewardType)
    {
        string path = string.Empty;

        switch (rewardType)
        {
        case GameLevelRewardType.Equip:
            path = "EquipIcon";
            break;

        case GameLevelRewardType.Item:
            path = "ItemIcon";
            break;

        case GameLevelRewardType.Material:
            path = "MaterialIcon";
            break;
        }

        return(Resources.Load <Sprite>(string.Format("UI/{0}/{1}", path, name)));
    }
 public void SetUI(int id, string name, GameLevelRewardType rewardType)
 {
     m_Icon.sprite     = GameUtil.LoadGameIcon(id.ToString(), rewardType);
     m_RewardName.text = name;
 }