public Texture2D GetIcon(int id) { LoadedIcon l = GetLoadedIcon(id); if (l != null) { return(l.icon); } else { return(LoadIcon(id)); } }
private Texture2D LoadIcon(int id) { LoadedIcon newIcon = new LoadedIcon(); newIcon.id = id; newIcon.icon = Resources.Load <Texture2D>("CustomizableCharacters/Icons/" + id); if (newIcon.icon != null) { loadedIcons.Add(newIcon); return(newIcon.icon); } else { return(GetIcon(0)); } }