Beispiel #1
0
    void AtivaIma()
    {
        if (imaContador > 1)
        {
            imaContador = 0;
        }
        Ima imaPonta = imaPonta = Imas[imaContador].GetComponentInChildren <Ima>();

        CharacterController jogadorCC = Jogador.GetComponent <CharacterController>();

        imaVida = Imas[imaContador].GetComponent <Vida>();

        imaPonta.enabled = true;

        if (imaVida.vida == 0)
        {
            if (jogadorCC.enabled == true)
            {
                imaPonta.enabled = false;
                imaContador++;
            }
            imaVida.AtualizaVida(imaVida.maxVida);
            TrocaEstado(Estados.SPAWNINIMIGO);
        }
    }
        private void Insertbtn_Click(object sender, EventArgs e)
        {
            string connStr = "server=localhost;user=root;database=birjha_truda;";
            // создаём объект для подключения к БД
            MySqlConnection connection = new MySqlConnection(connStr);

            connection.Open();
            string sql = "INSERT INTO `soiskateli`(`id_users`, `Last_name`, `Name`, `Father_name`, `Pol`, `Age`, `Pasport`, `Info`) VALUES " +
                         "(NULL, '" + Fam.Text + "','" + Ima.Text + "','" + Otch.Text + "','" + Pol.Text
                         + "','" + Age.Text + "','" + Pasport.Text + "','" + Inf.Text + "');";
            MySqlCommand command = new MySqlCommand(sql, connection);

            command.ExecuteNonQuery();
            connection.Close();
            Ima.Clear();
            Fam.Clear();
            Otch.Clear();
            Pol.Clear();
            Pasport.Clear();
            Age.Clear();
            Inf.Clear();
        }
 // The constructor is called when the attribute is set.
 public FieldSizeAttribute(Ima size)
 {
     fsize = size;
 }