// Callback used by UNET public void OnConnect(ServerClient svrclnt) { if (svrclnt == ServerClient.Server) { MasterNetAdapter.Spawn(prefab, transform.position, transform.rotation, null); } }
// Callback used by PUN public void OnJoinRoom() { if (MasterNetAdapter.ServerIsActive) { MasterNetAdapter.Spawn(prefab, transform.position, transform.rotation, null); } }
public void OnNstMasterStartServer() { if (MasterNetAdapter.ServerIsActive) { GameObject go = Instantiate(prefab, null); go.transform.position = transform.position; MasterNetAdapter.Spawn(go); } }