private void UpdateSquares() { var r = new Random(); var number = r.Next(0, 8); for (int i = 0; i < _squares.Count; i++) { if (i == number) { _squares[i].SetColor(_corAtual); } else { var cor = _colors.RandomElement(); var core = Color.FromBytes((byte)cor.R, (byte)cor.G, (byte)cor.B); while (core == _corAtual || _squares.Any(i => i.ColorReference == core)) { cor = _colors.RandomElement(); core = Color.FromBytes((byte)cor.R, (byte)cor.G, (byte)cor.B); } _squares[i].SetColor(core); } } }
private void PickRandomColor() { _cor = _colors.RandomElement(); _corAtual = Color.FromBytes((byte)_cor.R, (byte)_cor.G, (byte)_cor.B); _text.String = "{outline:3}{shakeX:1}" + _cor.Name; _text.Color = Color.White; }
private IEnumerator SaveAndReset() { _manager.Rumble(0, 0); _text.String = "VOCE PERDEU!"; _text.Color = Color.Red; yield return(_coroutine.WaitForSeconds(3)); _text.String = _cor.Name; _text.Color = Color.FromBytes((byte)_cor.R, (byte)_cor.G, (byte)_cor.B); yield return(_coroutine.WaitForSeconds(3)); //Add firebase Logic Here _client.Child("Highscore").PutAsync(score.ToString()); _coroutine.StopAll(); SceneManager.LoadScene("SceneOne"); }
private void Reset() { _text.Color = Color.White; _squares.ForEach(i => i.SetColor(Color.FromDraw(System.Drawing.Color.White))); _manager.SetLightbar(System.Drawing.Color.White); }