/** * @brief Instantiates a new {@link IPhysicsManager}. * * @param trueSyncConfig Indicates if is 3D world. **/ public static IPhysicsManager New(TrueSyncConfig trueSyncConfig) { instance = new PhysicsWorldManager(); instance.Gravity = trueSyncConfig.gravity3D; instance.SpeculativeContacts = trueSyncConfig.speculativeContacts3D; return(instance); }
// start a match and send the same command to all other players public void MultiplayerPanel_StartMatchBtn() { PhotonNetwork.room.visible = false; int syncWindow = int.Parse(configSyncWindow.text); int rollbackWindow = int.Parse(configRollbackWindow.text); int panicWindow = int.Parse(configPanicWindow.text); TrueSyncConfig globalConfig = TrueSyncManager.TrueSyncGlobalConfig; if (!(syncWindow != globalConfig.syncWindow || rollbackWindow != globalConfig.rollbackWindow || panicWindow != globalConfig.panicWindow)) { syncWindow = -1; } photonView.RPC("StartMatch", PhotonTargets.All, syncWindow, rollbackWindow, panicWindow); }
/** * @brief Instantiates a new {@link IPhysicsManager}. * * @param trueSyncConfig Indicates if is a 2D or 3D world. **/ public static IPhysicsManager New(TrueSyncConfig trueSyncConfig) { if (trueSyncConfig.physics3DEnabled) { instance = new PhysicsWorldManager(); instance.Gravity = trueSyncConfig.gravity3D; instance.SpeculativeContacts = trueSyncConfig.speculativeContacts3D; } else if (trueSyncConfig.physics2DEnabled) { instance = new Physics2DWorldManager(); instance.Gravity = new TSVector(trueSyncConfig.gravity2D.x, trueSyncConfig.gravity2D.y, 0); instance.SpeculativeContacts = trueSyncConfig.speculativeContacts2D; } return(instance); }
// start a match and send the same command to all other players public void MultiplayerPanel_StartMatchBtn() { //PhotonNetwork.room.IsVisible = false; // Makes the room not show from the lobby listing PhotonNetwork.room.IsOpen = false; // Closes the room, but still shows in lobby. How a closed room appears is modified in MatchJoiner.cs int syncWindow = int.Parse(configSyncWindow.text); int rollbackWindow = int.Parse(configRollbackWindow.text); int panicWindow = int.Parse(configPanicWindow.text); TrueSyncConfig globalConfig = TrueSyncManager.TrueSyncGlobalConfig; if (!(syncWindow != globalConfig.syncWindow || rollbackWindow != globalConfig.rollbackWindow || panicWindow != globalConfig.panicWindow)) { syncWindow = -1; } photonView.RPC("StartMatch", PhotonTargets.All, syncWindow, rollbackWindow, panicWindow); }