Example #1
0
    public void Init(PlayerProfile playerProfile, MicProfile micProfile)
    {
        lineDisplayer = GetComponentInChildren <LineDisplayer>();
        lineDisplayer.Init(6);

        sentenceDisplayer = GetComponentInChildren <SentenceDisplayer>();
        sentenceDisplayer.Init(12, micProfile);

        totalScoreDisplayer = GetComponentInChildren <TotalScoreDisplayer>();

        sentenceRatingDisplayer = GetComponentInChildren <SentenceRatingDisplayer>();

        beatGridDisplayer = GetComponentInChildren <BeatGridDisplayer>();

        currentBeatGridDisplayer = GetComponentInChildren <CurrentBeatGridDisplayer>();

        PlayerNameText playerNameText = GetComponentInChildren <PlayerNameText>();

        playerNameText.SetPlayerProfile(playerProfile);

        AvatarImage avatarImage = GetComponentInChildren <AvatarImage>();

        avatarImage.SetPlayerProfile(playerProfile);

        if (micProfile != null)
        {
            totalScoreDisplayer.SetColorOfMicProfile(micProfile);
            avatarImage.SetColorOfMicProfile(micProfile);
        }
    }
Example #2
0
    public void Init(PlayerProfile playerProfile, MicProfile micProfile)
    {
        lineDisplayer = GetComponentInChildren <LineDisplayer>();
        lineDisplayer.Init(6);

        sentenceDisplayer = GetComponentInChildren <SentenceDisplayer>();
        sentenceDisplayer.Init(12, micProfile);

        totalScoreDisplayer = GetComponentInChildren <TotalScoreDisplayer>();

        sentenceRatingDisplayer = GetComponentInChildren <SentenceRatingDisplayer>();

        beatGridDisplayer = GetComponentInChildren <BeatGridDisplayer>();

        currentBeatGridDisplayer = GetComponentInChildren <CurrentBeatGridDisplayer>();

        PlayerNameText playerNameText = GetComponentInChildren <PlayerNameText>();

        playerNameText.SetPlayerProfile(playerProfile);

        AvatarImage avatarImage = GetComponentInChildren <AvatarImage>();

        avatarImage.SetPlayerProfile(playerProfile);

        if (micProfile != null)
        {
            totalScoreDisplayer.SetColorOfMicProfile(micProfile);
            avatarImage.SetColorOfMicProfile(micProfile);
        }

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