public static GameObject GetPrefab(string name, MyPrefabType prefabType) { string path = GetPrefabPath(prefabType); GameObject go = Resources.Load(path + name) as GameObject; return(go); }
public static string GetPrefabPath(MyPrefabType prefabType) { switch (prefabType) { case MyPrefabType.Effect: return(EffectPath); case MyPrefabType.Card: return(CardPath); case MyPrefabType.MJ: return(mjPath); } return(""); }