예제 #1
0
    public void Init(SongMeta songMeta, PlayerProfile playerProfile, string voiceIdentifier, MicProfile micProfile)
    {
        this.SongMeta      = songMeta;
        this.PlayerProfile = playerProfile;
        this.MicProfile    = micProfile;

        Voice = LoadVoice(songMeta, voiceIdentifier);
        PlayerScoreController.Init(Voice);
        PlayerNoteRecorder.Init(this, playerProfile, micProfile);
    }
예제 #2
0
    public void Init(PlayerProfile playerProfile, string voiceName, MicProfile micProfile)
    {
        this.PlayerProfile      = playerProfile;
        this.MicProfile         = micProfile;
        this.Voice              = GetVoice(songMeta, voiceName);
        this.playerUiController = Instantiate(playerUiControllerPrefab, playerUiArea.transform);
        this.childrenInjector   = CreateChildrenInjectorWithAdditionalBindings();

        // Inject all
        foreach (INeedInjection childThatNeedsInjection in GetComponentsInChildren <INeedInjection>())
        {
            childrenInjector.Inject(childThatNeedsInjection);
        }
        childrenInjector.Inject(playerUiController);

        // Init instances
        playerUiController.Init(PlayerProfile, MicProfile);
        PlayerScoreController.Init(Voice);
    }
예제 #3
0
    public void Init(SongMeta songMeta, PlayerProfile playerProfile, string voiceIdentifier)
    {
        this.SongMeta      = songMeta;
        this.PlayerProfile = playerProfile;

        Voice = LoadVoice(songMeta, voiceIdentifier);

        playerUiArea = FindObjectOfType <PlayerUiArea>();

        PlayerScoreController = GetComponentInChildren <PlayerScoreController>();
        PlayerScoreController.Init(Voice);

        PlayerNoteRecorder = GetComponentInChildren <PlayerNoteRecorder>();
        if (PlayerNoteRecorder == null)
        {
            throw new NullReferenceException("PlayerNoteRecorder is null!");
        }
        PlayerNoteRecorder.Init(this, playerProfile.Difficulty.RoundingDistance);

        CreatePlayerUi();

        sentenceIndex = 0;
        UpdateSentences(sentenceIndex);
    }