public List<Item> GetEnemyDropsForRegion(string enemyId) { EnemyDropList list = new EnemyDropList(); enemyDrops.TryGetValue(enemyId, out list); //Debug.Log("enemyDrops " + enemyDrops.Count); //Debug.Log("drops for enemy ID " + enemyId + ": " + list.ItemList.Count); return list.ItemList; }
private void FindDropItem() { EnemyDropList dropList = GameObject.Find("World").transform.Find("Enemies").GetComponent <EnemyDropList>(); if (dropList != null) { for (int i = 0; i < dropList.Enemies.Count; i++) { if (dropList.Enemies[i].Enemy.name == this.gameObject.name) { List <int> ItemsToSpawn = dropList.SpawnRandormDrop(i); if (ItemsToSpawn == null) { return; } dropList.SpawnItem(i, ItemsToSpawn, this.gameObject.transform); } } } }