Exemple #1
0
        private void determineIfLocalPlayer()
        {
            AvatarDataHandle component = GetComponent <AvatarDataHandle>();

            if (component != null && !component.Handle.IsNull && dataEntityCollection.TryGetComponent <SessionIdData>(component.Handle, out var component2))
            {
                isLocalPlayer = dataEntityCollection.IsLocalPlayer(component2.SessionId);
            }
        }
        private void addChatMessageToPool(long sessionId)
        {
            float y  = layoutElementPool.ElementScrollRect.content.anchoredPosition.y;
            float y2 = layoutElementPool.ElementScrollRect.content.sizeDelta.y;

            if (dataEntityCollection.IsLocalPlayer(sessionId))
            {
                layoutElementPool.AddElement(1);
            }
            else
            {
                DataEntityHandle        dataEntityHandle = findPlayerHandle(sessionId);
                List <DataEntityHandle> friendsList      = FriendsDataModelService.FriendsList;
                bool flag = false;
                for (int i = 0; i < friendsList.Count; i++)
                {
                    if (friendsList[i] == dataEntityHandle)
                    {
                        flag = true;
                        break;
                    }
                }
                if (flag)
                {
                    layoutElementPool.AddElement(1, 2);
                }
                else
                {
                    layoutElementPool.AddElement(1, 1);
                }
            }
            if (y < -20f)
            {
                StartCoroutine(scrollToOriginalPosition(y2, y));
            }
        }
 public void PlayerHeldObjectChanged(long playerId, DHeldObject obj)
 {
     if (obj == null || obj.ObjectId == null)
     {
         if (userIdToPropUser.TryGetValue(playerId, out var value) && value.Prop != null && value.PendingExperienceId == -1)
         {
             onPropStored(playerId);
         }
     }
     else if (dataEntityCollection.IsLocalPlayer(playerId))
     {
         if (LocalPlayerPropUser != null)
         {
             onPlayerPropRetrieved(obj.ObjectId, GetPropDefinition(obj.ObjectId).PropAssetContentKey, playerId);
         }
     }
     else
     {
         onPlayerPropRetrieved(obj.ObjectId, GetPropDefinition(obj.ObjectId).PropAssetContentKey, playerId);
     }
 }
 private bool isLocalPlayer(long sessionId)
 {
     return(dataEntityCollection.IsLocalPlayer(sessionId));
 }