Network Manager HUD
Network Proximity Checker

Network Manager

Network Manager 컴포넌트는 네트워크 게임의 상태를 제어하는 데 사용할 수 있습니다. 이 컴포넌트는 에디터에서 네트워크 , 게임 오브젝트를 스폰하는 데 사용되는 프리팹, 그리고 다양한 네트워크 게임 상태에 사용할 씬을 설정하기 위한 인터페이스를 제공합니다.

네트워크 관리자를 게임에 구현하는 방법에 대한 자세한 내용은 네트워크 관리자 사용에 대한 문서를 참조하십시오.

인스펙터 창의 Network Manager 컴포넌트
인스펙터 창의 Network Manager 컴포넌트
프로퍼티 기능
로드 시 삭제 안 함(Dont Destroy On Load) 이 프로퍼티는 씬이 변경될 때 Unity가 네트워크 관리자가 포함된 게임 오브젝트를 삭제할지 여부를 제어합니다. 게임 내 씬이 변경될 때 Unity가 네트워크 관리자 게임 오브젝트를 삭제하지 않도록 하려면 이 체크박스를 선택하십시오. 이 체크박스를 선택 해제하면 게임 오브젝트가 존재하는 씬이 비활성 씬으로 바뀔 때 Unity가 해당 게임 오브젝트를 삭제합니다. 이 기능은 각 씬에서 여러 개의 별도 네트워크 관리자 게임 오브젝트를 관리할 때 유용합니다. 이 체크박스는 기본적으로 선택되어 있습니다.
백그라운드 실행(Run In Background) 이 프로퍼티는 네트워크 게임이 실행 중인 창에 포커스가 없을 때 해당 네트워크 게임을 실행할지 여부를 제어합니다. 창에 포커스가 없을 때도 게임을 실행하려면 이 체크박스를 선택하고, 게임을 중지하려면 이 체크박스를 선택 해제하십시오. 이 체크박스는 기본적으로 선택되어 있습니다. 동일한 컴퓨터에서 여러 개의 프로그램 인스턴스를 실행할 경우(예: localhost를 사용하여 테스트하는 경우) 이 프로퍼티를 활성화해야 합니다. 단, 모바일 플랫폼에 배포할 때는 이 프로퍼티를 비활성화해야 합니다. 활성화하면, 네트워크 관리자가 시작할 때 Application.runInBackground가 true로 설정됩니다. 이 프로퍼티는 Unity 메뉴의 편집(Edit) > 프로젝트 설정(Project Settings) > 플레이어 설정(Player Settings) > 해상도 및 프레젠테이션(Resolution & Presentation)에서 설정할 수도 있습니다.
로그 레벨(Log Level) 이 프로퍼티는 Unity가 콘솔 창에 출력하는 정보의 양을 제어합니다. 낮은 레벨로 설정하면 정보가 더 많이 표시되고 높은 레벨로 설정하면 정보가 더 적게 표시됩니다. 각 레벨에는 모든 상위 레벨의 메시지가 포함됩니다. 예를 들어 “경고(Warn)”를 선택하면 콘솔은 모든 “오류(Error)” 및 “치명적(Fatal)” 로그 메시지도 출력합니다. 드롭다운에는 낮은 레벨에서 높은 레벨순으로 나열되어 있습니다. 기본적으로 이 프로퍼티는 정보(Info)로 설정되어 있습니다. 로그 레벨(Log Level)을 스크립팅에서 설정(Set in Scripting)으로 설정하여 네트워크 관리자가 로그 레벨을 설정하지 못하게 만들 수도 있습니다. 즉, 자체 스크립트를 통해 레벨을 제어할 수 있게 됩니다.
오프라인 씬(Offline Scene) 이 필드에 씬을 할당하면, 클라이언트 연결이 해제되거나 서버가 종료되는 등 네트워크 세션이 중지될 때 네트워크 관리자가 지정된 씬으로 자동으로 전환합니다.
온라인 씬(Online Scene) 이 필드에 씬을 할당하면, 클라이언트가 서버에 연결하거나 서버가 연결 수신을 시작하는 등 네트워크 세션이 시작될 때 네트워크 관리자가 지정된 씬으로 자동으로 전환합니다.
Network Info You can expand this section of the inspector to access network-related settings, listed below
Use Web Sockets When running as a host, enable this setting to make the host listen for WebSocket connections instead of normal transport layer connections, so that WebGL clients can connect to it (if you build your game for the WebGL platform). These WebGL instances of your game cannot act as a host (in either peer-hosted or server-only mode). Therefore, for WebGL instances of your multiplayer game to be able to find each other and play together, you must host a server-only instance of your game running in LAN mode, with a publicly reachable IP address, and it must have this option enabled. This checkbox is unticked by default.
Network Address The network address currently in use. For clients, this is the address of the server that is connected to. For servers, this is the local address. This is set to ‘localhost’ by default.
Network Port The network port currently in use. For clients, this is the port of the server connected to. For servers, this is the listen port. This is set to 7777 by default.
Server Bind To IP Allows you to tell the server whether to bind to a specific IP address. If this checkbox is not ticked, then there is no specific IP address bound to (IP_ANY). This checkbox is unticked by default. Use this if your server has multiple network addresses (eg, internal LAN, external internet, VPN) and you want to specific the IP address to serve your game on.
Server Bind Address This field is only visible when the Server Bind To IP checkbox is ticked. Use this to enter the specific IP address that the server should bind to.
Script CRC Check When this is enabled, Unity checks that the clients and the server are using matching scripts. This is useful to make sure outdated versions of your client are not connecting to the latest (updated) version of your server. This checkbox is ticked by default. It does this by performing a (CRC check)[https://en.wikipedia.org/wiki/Cyclic_redundancy_check] between the server and client that ensures the NetworkBehaviour scripts match. This may not be appropriate in some cases, such as when you are intentionally using different Unity projects for the client and server. In most other cases however, you should leave it enabled.
Max Delay The maximum time in seconds to delay buffered messages. The default of 0.01 seconds means packets are delayed at most by 10 milliseconds. Setting this to zero disables HLAPI connection buffering. This is set to 0.01 by default.
Max Buffered Packets The maximum number of packets that a NetworkConnection can buffer for each channel. This corresponds to the ChannelOption.MaxPendingBuffers channel option. This is set to 16 by default.
Packet Fragmentation This allows the NetworkConnection instances to fragment packets that are larger than maxPacketSize, to up a maximum of 64K. This can cause delays in sending large packets. This checkbox is ticked by default.
MatchMaker Host URI The host address for the MatchMaker server. By default this points to the global Unity Multiplayer Service at mm.unet.unity3d.com, and usually you should not need to change this. Unity automatically groups players of your game into regional servers around the world, which ensures fast multiplayer response times between players in the same region. This means, for example, that players from Europe, the US, and Asia generally end up playing with other players from their same global region. You can override this value to explicitly control which regional server your game connects to. You might want to do this via scripting if you want to give your players the option of joining a server outside of their global region. For example, if “Player A” (in the US) wanted to connect to a match created via matchmaker by “Player B” (in Europe), they would need to be able to set their desired global region in your game. Therefore you would need to write a UI feature which allows them to select this. See API reference documentation on NetworkMatch.baseUri for more information, and for the regional server URIs.
MatchMaker Port The host port for the Matchmaker server. By default this points to port 443, and usually you should not need to change this.
Match Name Define the name of the current match. This is set to “default” by default.
Maximum Match Size Define the maximum number of players in the current match. This is set to 4 by default.
SpawnInfo You can expand this section of the inspector to access spawn-related settings, listed below
Player Prefab Define the default prefab Unity should use to create player GameObjects on the server. Unity creates Player GameObjects in the default handler for AddPlayer on the server. Implement (OnServerAddPlayer)[https://docs.unity3d.com/ScriptReference/Networking.NetworkManager.OnServerAddPlayer.html] to override this behaviour.
Auto Create Player Tick this checkbox if you want Unity to automatically create player GameObjects on connect, and when the Scene changes. This checkbox is ticked by default. Note that if you are using the MigrationManager and you do not enable Auto Create Player, you need to call ClientScene.SendReconnectMessage when your client reconnects.
Player Spawn Method Define how Unity should decide where to spawn new player GameObjects. This is set to Random by default.
    Random Choose Random to spawn players at randomly chosen startPositions.
    Round Robin Choose Round Robin to cycle through startPositions in a set list.
Registered Spawnable Prefabs Use this list to add prefabs that you want the Network Manager to be aware of, so that it can spawn them. You can also add and remove them via scripting.
Advanced Configuration Tick this checkbox to reveal advanced configuration options in the Network Manager Inspector window.
    Max Connections Define the maximum number of concurrent network connections to support. This is set to 4 by default.
    Qos Channels A list containing the different communication channels the current Network Manager has, and the Quality Of Service (QoS) setting for each channel. Use this list to add or remove channels, and adjust their QoS setting. You can also configure the channels via scripting. For the descriptions of each QoS option, see QosType.
    Timeouts
        Min Update Timeout Set the minimum time (in milliseconds) the network thread waits between sending network messages. The network thread doesn’t send multiplayer network messages immediately. Instead, it check each connection periodically at a fixed rate to see if it has something to send. This is set to 10ms by default. See API reference documentation on MinUpdateTimeout for more information.
        Connect Timeout Define the amount of time (in milliseconds) Unity should wait while trying to connect before attempting the connection again. This is set to 2000ms by default. See API reference documentation on ConnectTimeout for more information.
        Disconnect Timeout The amount of time (in milliseconds) before Unity considers a connection to be disconnected. This is set to 2000ms by default. See API reference documentation on DisconnectTimeout for more information.
        Ping Timeout The amount of time (in milliseconds) between sending pings (also known as “keep-alive” packets). The ping timeout duration should be approximately one-third to one-quarter of the Disconnect Timeout duration, so that Unity doesn’t assume that clients are disconnected until the server has failed to receive at least three pings from the client. This is set to 500ms by default. See API reference documentation on ConnectionConfig.PingTimeout for more information.
    Global Config These settings relate to the Reactor. The Reactor is the part of the multiplayer system which receives network packets from the underlying operating system, and passes them into the multiplayer system for processing.
        Thread Awake Timeout The timeout duration in milliseconds, used by the Reactor. How the Reactor uses this value depends on which Reactor Model you select (see below). This is set to 1ms by default.
        Reactor Model Choose which type of reactor to use. The reactor model defines how Unity reads incoming packets. For most games and applications, the default Select reactor is appropriate. If you want to trade a small delay in the processing of network messages for lower CPU usage and improved battery life, use the Fix Rate reactor.
        Select Reactor This model uses the select() API which means that the network thread “awakens” (becomes active) as soon as a packet is available. Using this method means your game gets the data as fast as possible. This is the default Reactor Model setting.
        Fix Rate Reactor This model lets the network thread sleep manually for a given amount of time (defined by the value in Thread Awake Timeout) before checking whether there are incoming packets waiting to be processed.
        Reactor Max Recv Messages Set the maximum number of messages stored in the receive queue. This is set to 1024 messages by default.
        Reactor Max Sent Messages Set the maximum number of messages stored in the send queue. This is set to 1024 messages by default.
Use Network Simulator Tick this checkbox to enable the usage of the network simulator. The network simulator introduces simulated latency and packet loss based on the following settings:
    Simulated Average Latency The amount of delay in milliseconds to simulate.
    Simulated Packet Loss The amount of packet loss to simulate in percent.
Network Manager HUD
Network Proximity Checker