private void RegisterPlayer(NetworkRacket networkRacket, Action onRegisterdCallbak) { if (NetworkManager.IsHost) { if (networkRacket.isLocalPlayer) { networkRacket.Object.Setup(RacketType.Bottom); _racket = networkRacket.Object; } else { networkRacket.Object.Setup(RacketType.Top); } } else { if (networkRacket.isLocalPlayer) { networkRacket.Object.Setup(RacketType.Top); _racket = networkRacket.Object; } else { networkRacket.Object.Setup(RacketType.Bottom); } } ResetRacket(networkRacket.Object); networkRacket.gameObject.SetActive(true); onRegisterdCallbak.SafeInvoke(); }
public static void RegisterPlayer(NetworkRacket networkRacket) { if (_multiPlayerGameModeInstance != null) { _multiPlayerGameModeInstance.RegisterRacket(networkRacket, () => _connectedPlayers++); } }
public void RegisterRacket(NetworkRacket networkRacket, Action onRegisterdCallbak) { networkRacket.gameObject.SetActive(false); this.WaitForSeconds(1f, () => RegisterPlayer(networkRacket, onRegisterdCallbak)); }