private void Start() { _curColorIndex = 0; OnChangeColour?.Invoke(SelectedColor); gameState = GameState.Painting; }
private void Update() { if (Input.GetAxis("Mouse ScrollWheel") > 0f) // forward { ++_curColorIndex; if (_curColorIndex >= ColourPalette.Length) { _curColorIndex = 0; } OnChangeColour?.Invoke(SelectedColor); } else if (Input.GetAxis("Mouse ScrollWheel") < 0f) // backwards { --_curColorIndex; if (_curColorIndex < 0) { _curColorIndex = ColourPalette.Length - 1; } OnChangeColour?.Invoke(SelectedColor); } if (Input.GetKeyDown(KeyCode.Alpha1)) { gameState = GameState.Menu; } if (Input.GetKeyDown(KeyCode.Alpha2)) { gameState = GameState.Painting; } if (Input.GetKeyDown(KeyCode.Alpha3)) { gameState = GameState.Exhibition; } }