Beispiel #1
0
        void OnClientConnected(INetworkPlayer player)
        {
            syncVarReceiver = new SyncVarReceiver(Client, Client.World);
            RegisterSpawnPrefabs();

            if (Client.IsLocalClient)
            {
                RegisterHostHandlers();
            }
            else
            {
                RegisterMessageHandlers();
            }
        }
Beispiel #2
0
        private void OnClientConnected(INetworkPlayer player)
        {
            _syncVarReceiver = new SyncVarReceiver(Client, Client.World);
            RegisterSpawnPrefabs();

            // prepare objects right away so objects in first scene can be spawned
            // if user changes scenes without NetworkSceneManager then they will need to manually call it again
            PrepareToSpawnSceneObjects();

            if (Client.IsLocalClient)
            {
                RegisterHostHandlers();
            }
            else
            {
                RegisterMessageHandlers();
            }
        }
Beispiel #3
0
 void OnClientDisconnected()
 {
     ClearSpawners();
     DestroyAllClientObjects();
     syncVarReceiver = null;
 }
Beispiel #4
0
 private void OnClientDisconnected(ClientStoppedReason reason)
 {
     ClearSpawners();
     DestroyAllClientObjects();
     _syncVarReceiver = null;
 }