private async void MakeRequest(string swap, string loot) { Cursor = Cursors.WaitCursor; await Task.Run(() => { SwapBL.Start(swap); }); await Task.Run(() => { lootItems = LootItems.FromJson(GetJSONData.GetLootItems(loot)); }); Task.WaitAll(); toolStripStatusLabel1.Text = "Swap.gg total item: " + SwapBL.swapItems.Result.Count; toolStripStatusLabel2.Text = "Loot.farm total item: " + lootItems.Count; await Task.Run(() => { var s = DataSource.GetDataSource(SwapBL, lootItems); if (s != dataGridView1.DataSource) { BeginInvoke(new MethodInvoker(() => dataGridView1.DataSource = s)); } }); Cursor = Cursors.Default; }
public LootSystem() { if (instance == null) { instance = this; } lootMap = new Dictionary <int, LootItems>(); LootItems loot = new LootItems(10); lootMap.Add(1, loot); }
public void Die() { health = 0; gameObject.SetActive(false); LootSystem lootSystem = LootSystem.instance; LootItems items = lootSystem.GetLootForCreature(1); float y = 0.0f; Vector3 newPos = transform.position; if (Physics.Raycast(transform.position, -transform.up, out RaycastHit hit)) { y = hit.point.y; newPos.y = y; } GameObject gold = Instantiate(goldPrefab, newPos, transform.rotation); Destroy(gold, 5.0f); }
public T FirstOrDefault <T>() where T : Loot { return(LootItems.FirstOrDefault() as T); }
public Loot FirstOrDefault() { return(LootItems.FirstOrDefault()); }