Example #1
0
    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;
        }
    }
Example #2
0
    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"]);
    }