private void btnigual_Click(object sender, EventArgs e) { // Programando o botão de = com base nas classes criadas // segundo = double.Parse(tbxScreen.Text); double Som; double Su; double Mul; double Div; switch (operador) { case "+": Som = obj.Somar((primeiro), (segundo)); tbxScreen.Text = Som.ToString(); break; case "-": Su = obj2.subtracao((primeiro), (segundo)); tbxScreen.Text = Su.ToString(); break; case "*": Mul = obj3.Multiplicao((primeiro), (segundo)); tbxScreen.Text = Mul.ToString(); break; case "/": Div = obj4.Divisao((primeiro), (segundo)); tbxScreen.Text = Div.ToString(); break; } }
/// <summary> /// Play an Audio Clip defined in the inspector /// </summary> /// <param name="sound"></param> public void Play(Som som) { string sound = som.ToString(); EasyAudioUtility_Helper h = Array.Find(helper, item => item.name == sound); if (h != null) { //randomizing volume by variation h.source.volume = h.volume; //randomizing pitch by variation h.source.pitch = h.pitch; //playing it after setting all variations if (h.source.enabled) { h.source.Play(); } } }