mixedcards/Assets/Battle/HeroDatabase.cs
henriquenakashima 3cb9eb5031 Initial import
2020-09-17 22:52:50 -04:00

27 lines
757 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum HeroId {
Alchemist,
Brute,
Shaman,
}
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]);
if (spritePrefab == null) {
throw new System.ArgumentException("No sprite for HeroId", "id");
}
return GameObject.Instantiate(spritePrefab);
}
}