Пример #1
0
        public LobbyAvatarPlaceLighting GetConnectedPlayerPlace(IConnectedPlayer player)
        {
            int     sortIndex = _lobbyStateDataModel.localPlayer.sortIndex;
            float   outerCirclePositionAngleForPlayer = MultiplayerPlayerPlacement.GetOuterCirclePositionAngleForPlayer(player.sortIndex, sortIndex, angleBetweenPlayersWithEvenAdjustment);
            Vector3 playerWorldPosition = MultiplayerPlayerPlacement.GetPlayerWorldPosition(outerCircleRadius, outerCirclePositionAngleForPlayer, MultiplayerPlayerLayout.Circle);

            return(Array.Find(avatarPlaces, place => place.transform.position == playerWorldPosition && place.isActiveAndEnabled));
        }
        public MultiplayerLobbyAvatarPlace GetConnectedPlayerPlace(IConnectedPlayer player)
        {
            float innerCircleRadius    = _placeManager.GetField <float, MultiplayerLobbyAvatarPlaceManager>("_innerCircleRadius");
            float minOuterCircleRadius = _placeManager.GetField <float, MultiplayerLobbyAvatarPlaceManager>("_minOuterCircleRadius");

            float angleBetweenPlayersWithEvenAdjustment = MultiplayerPlayerPlacement.GetAngleBetweenPlayersWithEvenAdjustment(_lobbyStateDataModel.maxPartySize, MultiplayerPlayerLayout.Circle);
            float outerCircleRadius = Mathf.Max(MultiplayerPlayerPlacement.GetOuterCircleRadius(angleBetweenPlayersWithEvenAdjustment, innerCircleRadius), minOuterCircleRadius);
            int   sortIndex         = _lobbyStateDataModel.localPlayer.sortIndex;

            float   outerCirclePositionAngleForPlayer = MultiplayerPlayerPlacement.GetOuterCirclePositionAngleForPlayer(player.sortIndex, sortIndex, angleBetweenPlayersWithEvenAdjustment);
            Vector3 playerWorldPosition = MultiplayerPlayerPlacement.GetPlayerWorldPosition(outerCircleRadius, outerCirclePositionAngleForPlayer, MultiplayerPlayerLayout.Circle);

            MultiplayerLobbyAvatarPlace[] places      = Resources.FindObjectsOfTypeAll <MultiplayerLobbyAvatarPlace>();
            MultiplayerLobbyAvatarPlace   playerPlace = Array.Find(places, place => place.transform.position == playerWorldPosition && place.isActiveAndEnabled);

            return(playerPlace);
        }