private void loadPlayerRow(PartyGameSessionMessages.TubeRacePlayerResult result, int index = 0)
        {
            GameObject gameObject = ((result.PlayerId != Service.Get <CPDataEntityCollection>().LocalPlayerSessionId) ? Object.Instantiate(otherPlayerRowPrefab, rowParentTransform, worldPositionStays: false) : Object.Instantiate(localPlayerRowPrefab, rowParentTransform, worldPositionStays: false));

            gameObject.transform.SetSiblingIndex(index);
            gameObject.GetComponent <TubeRaceEndGamePopupRow>().SetData(result, partyGameDefinition);
        }
예제 #2
0
        private void setLocalPlayerData(PartyGameSessionMessages.TubeRacePlayerResult data)
        {
            DateTime dateTime = DateTimeUtils.DateTimeFromUnixTime(data.CompletionTimeInMilliseconds);

            TimeText.text     = dateTime.ToString("mm:ss:ff");
            ModifierText.text = Math.Abs(data.ScoreModifier).ToString();
            ModifierSpriteSelector.SelectSprite((!(data.ScoreModifier >= 0f)) ? 1 : 0);
            ModifierSignText.text = ((data.ScoreModifier >= 0f) ? "+" : "-");
        }
        private int getResultIndex(PartyGameSessionMessages.TubeRacePlayerResult result)
        {
            int result2 = playerResults.Count;

            for (int i = 0; i < playerResults.Count; i++)
            {
                if (result.OverallScore > playerResults[i].OverallScore)
                {
                    result2 = i;
                    break;
                }
            }
            return(result2);
        }
예제 #4
0
        public void SetData(PartyGameSessionMessages.TubeRacePlayerResult data, PartyGameDefinition partyGameDefinition)
        {
            skinForDefinition(partyGameDefinition);
            ScoreText.text = data.OverallScore.ToString();
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       dataEntityHandle       = cPDataEntityCollection.FindEntity <SessionIdData, long>(data.PlayerId);

            if (!dataEntityHandle.IsNull && cPDataEntityCollection.TryGetComponent <DisplayNameData>(dataEntityHandle, out var component))
            {
                NameText.text = component.DisplayName;
            }
            if (data.PlayerId == cPDataEntityCollection.LocalPlayerSessionId)
            {
                setLocalPlayerData(data);
            }
        }