// Use this for initialization void Start() { _playMenu = FindObjectOfType <PlayMenue>(); _backButton.onClick.AddListener(OnBackClick); _playButton.onClick.AddListener(OnPlayClick); _mapSizeText.text = "Map size: " + ((_mapSizeSlider.value < _mapSizeSlider.maxValue) ? _mapSizeSlider.value.ToString() : "Infinite"); _mapSizeSlider.onValueChanged.AddListener(delegate(float value) { _mapSizeText.text = "Map size: " + ((value < _mapSizeSlider.maxValue) ? value.ToString() : "Infinite"); }); _budgetInputField.onValueChanged.AddListener(delegate(string value) { Debug.Log(value); }); _playerColorInput.color = Color.blue; _playerColorChangeButton.onClick.AddListener(delegate { if (_playerColorInput.color.Equals(Color.blue)) { _playerColorInput.color = Color.red; } else if (_playerColorInput.color.Equals(Color.red)) { _playerColorInput.color = Color.green; } else if (_playerColorInput.color.Equals(Color.green)) { _playerColorInput.color = Color.cyan; } else if (_playerColorInput.color.Equals(Color.cyan)) { _playerColorInput.color = Color.blue; } }); }
// Use this for initialization void Start() { _backButton.onClick.AddListener(OnBackClick); _playMenue = FindObjectOfType <PlayMenue>(); }