private async void SelecionarCorPrograma_Click(object sender, RoutedEventArgs e) { MenuItem select = (MenuItem)sender; foreach (MenuItem i in Cores_mi.Items) { i.IsChecked = i == select; } //altera a cor await MudarCor.MudarAsync((string)select.Header); }
// Use this for initialization void Start() { GameObject pedraCorObject = GameObject.FindWithTag("pedra1"); if (pedraCorObject != null) { pc1 = pedraCorObject.GetComponent <MudarCor>(); } pedraCorObject = GameObject.FindWithTag("pedra2"); if (pedraCorObject != null) { pc2 = pedraCorObject.GetComponent <MudarCor>(); } pedraCorObject = GameObject.FindWithTag("pedra3"); if (pedraCorObject != null) { pc3 = pedraCorObject.GetComponent <MudarCor>(); } }