コード例 #1
0
    public Sprite DisplayItem(CharacterItemType itemType)
    {
        currentItems.TryGetValue(itemType, out int t);
        itemPaths.TryGetValue(itemType, out string p);

        string path = "Character/" + p + "/" + p + t.ToString();

        try
        {
            Debug.Log(path);
            return(Resources.Load <Sprite>(path));
        }
        catch
        {
            Debug.LogError("File path \"" + path + "\"does not exist!");
            return(null);
        }
    }
コード例 #2
0
 public static GenerateItemInfo GetInfo(Character chara, CharacterItemType type)
 {
     return(infos.FirstOrDefault(i => i.From == chara.From && i.ItemType == type));
 }