// ------------------------------------------------------------------------------- // OnSceneLoaded // @Client / @Server // ------------------------------------------------------------------------------- void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (NetworkServer.active && !GetIsMainZone) { if (GetSubZoneTimeoutInterval > 0) { InvokeRepeating(nameof(CheckSubZone), GetSubZoneTimeoutInterval, GetSubZoneTimeoutInterval); } } if (autoConnectClient) { networkManager.StartClient(); autoConnectClient = false; } }
// ------------------------------------------------------------------------------- // OnSceneLoaded // ------------------------------------------------------------------------------- void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (NetworkServer.active) { if (zoneName == scene.name && SubZoneTimeoutInterval > 0) { InvokeRepeating(nameof(CheckSubZone), SubZoneTimeoutInterval, SubZoneTimeoutInterval); } } if (autoConnectClient) { networkTransport.port = (ushort)(originalPort + zoneIndex); networkManager.StartClient(); autoConnectClient = false; } }