public static WeaponSpawnset Load(string path) { TextAsset _xml = Resources.Load <TextAsset>(path); XmlSerializer serializer = new XmlSerializer(typeof(WeaponSpawnset)); StringReader reader = new StringReader(_xml.text); WeaponSpawnset weapons = serializer.Deserialize(reader) as WeaponSpawnset; reader.Close(); return(weapons); }
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; }