Add guards and implement basic cards
This commit is contained in:
parent
30beb96397
commit
08c395cf51
32 changed files with 803 additions and 24 deletions
|
|
@ -6,18 +6,14 @@ public enum HeroId {
|
|||
Alchemist,
|
||||
Brute,
|
||||
Shaman,
|
||||
NPCGuard,
|
||||
}
|
||||
|
||||
public class HeroDatabase
|
||||
{
|
||||
private static Dictionary<HeroId, string> SPRITE_NAMES = new Dictionary<HeroId, string> {
|
||||
{HeroId.Alchemist, "AlchemistSprite"},
|
||||
{HeroId.Brute, "BruteSprite"},
|
||||
{HeroId.Shaman, "ShamanSprite"},
|
||||
};
|
||||
|
||||
public static GameObject createHeroSprite(HeroId id) {
|
||||
GameObject spritePrefab = (GameObject) Resources.Load<GameObject>("HeroImages/" + SPRITE_NAMES[id]);
|
||||
GameObject spritePrefab = (GameObject) Resources.Load<GameObject>(
|
||||
"HeroImages/" + id.ToString() + "Sprite");
|
||||
if (spritePrefab == null) {
|
||||
throw new System.ArgumentException("No sprite for HeroId", "id");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue