23 lines
563 B
C#
23 lines
563 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public enum HeroId {
|
|
Alchemist,
|
|
Brute,
|
|
Shaman,
|
|
NPCGuard,
|
|
}
|
|
|
|
public class HeroDatabase
|
|
{
|
|
public static GameObject createHeroSprite(HeroId id) {
|
|
GameObject spritePrefab = (GameObject) Resources.Load<GameObject>(
|
|
"HeroImages/" + id.ToString() + "Sprite");
|
|
if (spritePrefab == null) {
|
|
throw new System.ArgumentException("No sprite for HeroId", "id");
|
|
}
|
|
|
|
return GameObject.Instantiate(spritePrefab);
|
|
}
|
|
}
|