public void addSupply(supplies supply) { switch (supply) { case supplies.FUEL: fuel = true; textboxes[0].text = "✔"; break; case supplies.METAL: metal = true; textboxes[2].text = "✔"; break; case supplies.FOOD: food = true; textboxes[1].text = "✔"; break; case supplies.TECH: tech = true; textboxes[3].text = "✔"; break; } Count(); audio.GetComponent <soundEffect>().playing = true; // once all items have been collected, you win if (hasAllSupplies()) { hasSupplies = true; } }
public void addSupply(supplies supply) { switch (supply) { case supplies.FUEL: fuel = true; textboxes[0].text = "✔"; break; case supplies.METAL: metal = true; textboxes[2].text = "✔"; break; case supplies.FOOD: food = true; textboxes[1].text = "✔"; break; case supplies.TECH: tech = true; textboxes[3].text = "✔"; break; } music.GetComponent <soundEffect>().playing = true; // once all items have been collected, you win if (hasAllSupplies()) { SceneManager.LoadScene("Winner"); } }
private void supply_Load(object sender, EventArgs e) { // заполнение comboBox1 dataGridView1.Visible = false; using (var conn = new NpgsqlConnection(Options.connectionString)) { conn.Open(); var commStr = "SELECT id, name, mark FROM pmib6605.supplies"; var comm = new NpgsqlCommand(commStr, conn); var reader = comm.ExecuteReader(); while (reader.Read()) { if (reader.GetInt32(2) <= mark) { supplies sp = new supplies { id = reader.GetInt32(0), name = reader.GetString(1) }; sps.Add(sp); comboBox1.Items.Add(reader.GetString(1)); } } } }