public Stats(string type) { switch (type) { case "zombie": this.constructor(ZombieStats.toString()); this.prefab = zombiePrefab; break; case "flubber": this.constructor(FlubberStats.toString()); this.prefab = flubberPrefab; break; case "spider": this.constructor(SpiderStats.toString()); this.prefab = spiderPrefab; break; case "ghost": this.constructor(GhostStats.toString()); this.prefab = ghostPrefab; break; } }
private static void readXML() { TextAsset temporal = (TextAsset)Resources.Load("data/enemyData"); xmlAsset.LoadXml(temporal.text); ZombieStats.read(xmlAsset.ChildNodes[1]["zombie"]); FlubberStats.read(xmlAsset.ChildNodes[1]["flubber"]); SpiderStats.read(xmlAsset.ChildNodes[1]["spider"]); GhostStats.read(xmlAsset.ChildNodes[1]["ghost"]); }