Created
April 5, 2021 20:18
-
-
Save Jakz/640d0cf3965eaaf4730bc4628275348f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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