예제 #1
0
 public void Randomise()
 {
     _musoNameInput.text       = MusicianCreationHelper.GetRandomName();
     _bandNameInput.text       = MusicianCreationHelper.GetRandomName();
     _musicianPortrait.sprite  = MusicianCreationHelper.GetRandomSprite();
     _instrumentDropdown.value = rnd.Next(_instrumentDropdown.options.Count);
 }
예제 #2
0
    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];
            }
        }
    }
예제 #3
0
 public void Start()
 {
     _gameController = Instantiate(_gameControllerPrefab).GetComponent <GameController>();
     _gameController.gameObject.name = "GameController";
     _musicianPortrait.sprite        = MusicianCreationHelper.GetRandomSprite();
 }
예제 #4
0
    private void AddRandomMusician()
    {
        Musician musician = new Musician(MusicianCreationHelper.GetRandomName(), MusicianCreationHelper.GetRandomInstrument(), MusicianCreationHelper.GetRandomSprite());

        _gameController.AddMusician(musician);
    }