Skip to content

Instantly share code, notes, and snippets.

@Jakz
Created April 5, 2021 20:18
Show Gist options
  • Save Jakz/640d0cf3965eaaf4730bc4628275348f to your computer and use it in GitHub Desktop.
Save Jakz/640d0cf3965eaaf4730bc4628275348f to your computer and use it in GitHub Desktop.
class GameObject { }
class ElementSpec
{
public int ID;
public EffectType type;
public string effectName;
public GameObject turretToSpawn;
public GameObject magicForPlayer;
public ElementSpec(int ID, string effectName)
{
this.ID = ID;
this.effectName = effectName;
turretToSpawn = (GameObject)Resources.Load("prefabs/prefab1", typeof(GameObject));
}
}
class EffectSpecDatabase
{
private static List<ElementSpec> elements = new List<ElementSpec>();
void Awake()
{
elements.Add(new ElementSpec(0, "fire"));
elements.Add(new ElementSpec(1, "ice"));
}
public static ElementSpec ElementByID(int id)
{
ElementSpec spec = elements.Find(element => element.ID == id);
return spec;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment