Пример #1
0
 // Callback used by UNET
 public void OnConnect(ServerClient svrclnt)
 {
     if (svrclnt == ServerClient.Server)
     {
         MasterNetAdapter.Spawn(prefab, transform.position, transform.rotation, null);
     }
 }
Пример #2
0
 // Callback used by PUN
 public void OnJoinRoom()
 {
     if (MasterNetAdapter.ServerIsActive)
     {
         MasterNetAdapter.Spawn(prefab, transform.position, transform.rotation, null);
     }
 }
Пример #3
0
 public void OnNstMasterStartServer()
 {
     if (MasterNetAdapter.ServerIsActive)
     {
         GameObject go = Instantiate(prefab, null);
         go.transform.position = transform.position;
         MasterNetAdapter.Spawn(go);
     }
 }