Esempio n. 1
0
    public static PowerupSpawnset Load(string path)
    {
        TextAsset _xml = Resources.Load <TextAsset>(path);

        XmlSerializer serializer = new XmlSerializer(typeof(PowerupSpawnset));

        StringReader reader = new StringReader(_xml.text);

        PowerupSpawnset powerups = serializer.Deserialize(reader) as PowerupSpawnset;

        reader.Close();

        return(powerups);
    }
Esempio n. 2
0
 void Start()
 {
     TMPweaponnum     = GameObject.FindGameObjectWithTag("TMPweaponnum").GetComponent <TextMeshPro>();
     weaponPickupPos  = GameObject.Find("WBPickupPos").transform.position;
     passivePickupPos = GameObject.Find("PAPUPos").transform.position;
     powerupPickupPos = GameObject.Find("PUPUPos").transform.position;
     playerUnit       = FindObjectOfType <Player>().GetComponent <Unit>();
     aso              = FindObjectOfType <Player>().GetComponent <AudioSource>();
     es               = SpawnsetEnemies.Load(epath);
     egl              = SpawnsetEnemies.Load(eglpath);
     ws               = WeaponSpawnset.Load(wpath);
     pus              = PowerupSpawnset.Load(poupath);
     pas              = PassiveSpawnset.Load(papath);
     statl            = FindObjectOfType <StatLibrary>();
     spawnList        = es.spawns;
     weaponList       = ws.weapons;
     paList           = pas.passives;
     pulist           = pus.powerups;
     EGLSpawnList     = egl.spawns;
     usedSpawnList    = new List <Spawn>();
     usedEGLSpawnList = new List <Spawn>();
     pickupSpawned    = FindObjectOfType <SoundLibrary>().GetPickupSpawned();
     fastmode         = playerUnit.gameObject.GetComponent <Player>().fastmode;
 }