public void Randomise() { _musoNameInput.text = MusicianCreationHelper.GetRandomName(); _bandNameInput.text = MusicianCreationHelper.GetRandomName(); _musicianPortrait.sprite = MusicianCreationHelper.GetRandomSprite(); _instrumentDropdown.value = rnd.Next(_instrumentDropdown.options.Count); }
private void ScrollPortrait(int n) { List <Sprite> sprites = MusicianCreationHelper.GetAllSprites(); int indexOfCurrentSprite = sprites.IndexOf(_musicianPortrait.sprite); if (indexOfCurrentSprite != -1) { if (indexOfCurrentSprite == 0 && n < 0) { _musicianPortrait.sprite = sprites[sprites.Count - 1]; } else if (indexOfCurrentSprite == sprites.Count - 1 && n > 0) { _musicianPortrait.sprite = sprites[0]; } else { _musicianPortrait.sprite = sprites[indexOfCurrentSprite + n]; } } }
public void Start() { _gameController = Instantiate(_gameControllerPrefab).GetComponent <GameController>(); _gameController.gameObject.name = "GameController"; _musicianPortrait.sprite = MusicianCreationHelper.GetRandomSprite(); }
private void AddRandomMusician() { Musician musician = new Musician(MusicianCreationHelper.GetRandomName(), MusicianCreationHelper.GetRandomInstrument(), MusicianCreationHelper.GetRandomSprite()); _gameController.AddMusician(musician); }