Exemplo n.º 1
0
 private bool OnCreatePlayer(NeutronStream.IReader reader, bool isServer, bool isMine, NeutronPlayer player, Neutron instance)
 {
     if (instance.EndPlayer(reader, out var pos, out var rot))
     {
         NeutronSchedule.ScheduleTask(() =>
         {
             Neutron.NetworkSpawn(isServer, false, player, _player, pos, rot, instance);
         });
     }
Exemplo n.º 2
0
 protected override void OnPlayerJoinedChannel(NeutronChannel channel, NeutronPlayer player, bool isMine, Neutron neutron)
 {
     base.OnPlayerJoinedChannel(channel, player, isMine, neutron);
     {
         if (isMine)
         {
             using (NeutronStream stream = new NeutronStream())
             {
                 var writer = neutron.BeginPlayer(stream, Vector3.zero, Quaternion.identity);
                 writer.Write();
                 neutron.EndPlayer(stream, 10);
             }
         }
     }
 }