public void SetPlayerPlaceColor(IConnectedPlayer player, Color color) { MultiplayerLobbyAvatarPlace place = GetConnectedPlayerPlace(player); if (place != null) { foreach (TubeBloomPrePassLight light in place.GetComponentsInChildren <TubeBloomPrePassLight>()) { light.color = color; light.Refresh(); } } }
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); }