Exemple #1
0
    void SetWinnerContent(CharId winnerCharId)
    {
        Color winnerUIColor = winnerCharId.GetUIColor();

        // update nickname
        _winnerNickname.text = CharIdAllocator.GetNickname(winnerCharId);
        //_winnerNickname.color = winnerUIColor;

        // update profile picture
        _winnerProfilePictureOutline.color = winnerUIColor;
        ProfilePictureManager.Instance.SetProfilePicture(winnerCharId, _winnerProfilePicture);
    }
Exemple #2
0
    void SetSpecialPlayersContent(CharId winnerCharId)
    {
        var charIdsOrderByScore = GameManager.Instance.Gamemode.GetCharIdsOrderByScore();

        Assert.AreEqual(_specialPlayerWrappers.Length, Enum.GetValues(typeof(CharId)).Length - 1, "Special players wrapper should have " + (Enum.GetValues(typeof(CharId)).Length - 1) + " elements!");

        var characterStatistics            = FindObjectOfType <StatisticsManager>().CharacterStatistics;
        Dictionary <CharId, string> titles = GetSpecialTitle(winnerCharId, characterStatistics);

        for (int i = 0; i < _specialPlayerWrappers.Length; i++)
        {
            var wrapper = _specialPlayerWrappers[i];
            var charId  = charIdsOrderByScore[i + 1]; // we add 1 to skip the winner

            // if player is not connected
            if (!CharIdAllocator.IsCharIdConnected(charId))
            {
                // disable wrapper
                wrapper.gameObject.SetActive(false);
                continue;
            }

            wrapper.gameObject.SetActive(false);

            // content
            wrapper.UpdateCharIdContent(charId);
            wrapper.SpecialTitle.text = titles[charId];

            // animation
            float animationDelay = i * DELAY_BETWEEN_ANIMATION + i * ANIMATION_DURATION;

            this.ExecuteAfterTime(animationDelay, () => wrapper.gameObject.SetActive(true));

            wrapper.transform.localScale = Vector3.one * 1.4f;
            wrapper.transform.DOScale(Vector3.one, ANIMATION_DURATION)
            .SetEase(Ease.InQuint)
            .SetDelay(animationDelay)
            .OnComplete(() => CameraShake.Instance.Shake(0.1f, 0.05f));
        }
    }
Exemple #3
0
    public void SetProfilePicture(CharId charId, Image destination)
    {
        int deviceId = CharIdAllocator.GetDeviceId(charId);

        SetProfilePicture(deviceId, destination);
    }