Exemplo n.º 1
0
 internal LobbyEnvironmentManager(IMultiplayerSessionManager sessionManager, ILobbyStateDataModel lobbyStateDataModel, MenuEnvironmentManager menuEnvironmentManager, MultiplayerLobbyAvatarPlaceManager placeManager, MultiplayerLobbyCenterStageManager stageManager, ExtendedPlayerManager playerManager)
 {
     _sessionManager         = sessionManager;
     _lobbyStateDataModel    = lobbyStateDataModel;
     _menuEnvironmentManager = menuEnvironmentManager;
     _placeManager           = placeManager;
     _stageManager           = stageManager;
     _playerManager          = playerManager;
 }
        public void SetCenterScreenScale()
        {
            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);
            float scaleRatio        = outerCircleRadius / minOuterCircleRadius;

            MultiplayerLobbyCenterStageManager[] centerscreens = Resources.FindObjectsOfTypeAll <MultiplayerLobbyCenterStageManager>();
            if (centerscreens.Length == 0)
            {
                return;
            }
            MultiplayerLobbyCenterStageManager centerscreen = centerscreens.First();

            centerscreen.transform.localScale = new Vector3(scaleRatio, scaleRatio, scaleRatio);
        }