Example #1
0
        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();
        }
Example #2
0
 public static void RegisterPlayer(NetworkRacket networkRacket)
 {
     if (_multiPlayerGameModeInstance != null)
     {
         _multiPlayerGameModeInstance.RegisterRacket(networkRacket, () => _connectedPlayers++);
     }
 }
Example #3
0
 public void RegisterRacket(NetworkRacket networkRacket, Action onRegisterdCallbak)
 {
     networkRacket.gameObject.SetActive(false);
     this.WaitForSeconds(1f, () => RegisterPlayer(networkRacket, onRegisterdCallbak));
 }