public void createWavesystem(triggerWaypoint startWaypoint)
    {
        _wavesystem = new GameObject("wavesystem");

        wavesystem wavesystem = _wavesystem.AddComponent <wavesystem>();

        Object[] objects = Resources.LoadAll("PrefabObjects/Elemental Invader");

        GameObject healthbar = Resources.Load <GameObject>("PrefabObjects/UI Elements/healthbar");

        GameObject[] invadertypes = new GameObject[4];
        invadertypes[0] = (GameObject)objects[0];
        invadertypes[1] = (GameObject)objects[1];
        invadertypes[2] = (GameObject)objects[2];
        invadertypes[3] = (GameObject)objects[3];

        poolmanager.instance.createPool("airInvader", 6, true, invadertypes[0]);
        poolmanager.instance.createPool("earthInvader", 6, true, invadertypes[1]);
        poolmanager.instance.createPool("fireInvader", 6, true, invadertypes[2]);
        poolmanager.instance.createPool("waterInvader", 6, true, invadertypes[3]);

        poolmanager.instance.createPool("healthbar", 10, true, healthbar, GameObject.Find("worldinterface"));

        wavesystem.initiate(0, 10, 1f, 10.0f, startWaypoint, invadertypes);
    }
    public void update()
    {
        wavesystem wavesystem = _wavesystem.GetComponent <wavesystem>();

        if (wavesystem != null)
        {
            wavesystem.update();
        }
    }