mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 03:28:26 +00:00
rename
This commit is contained in:
parent
2efdbe310f
commit
51bb10eedc
@ -18,7 +18,7 @@ namespace QSB.Anglerfish.WorldObjects
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
Object.Instantiate(QSBNetworkManager.Instance.AnglerPrefab).SpawnWithServerAuthority();
|
||||
Object.Instantiate(QSBNetworkManager.singleton.AnglerPrefab).SpawnWithServerAuthority();
|
||||
}
|
||||
|
||||
StartDelayedReady();
|
||||
|
@ -17,7 +17,7 @@ namespace QSB.JellyfishSync.WorldObjects
|
||||
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
Object.Instantiate(QSBNetworkManager.Instance.JellyfishPrefab).SpawnWithServerAuthority();
|
||||
Object.Instantiate(QSBNetworkManager.singleton.JellyfishPrefab).SpawnWithServerAuthority();
|
||||
}
|
||||
|
||||
StartDelayedReady();
|
||||
|
@ -43,9 +43,9 @@ namespace QSB.Menus
|
||||
Instance = this;
|
||||
MakeTitleMenus();
|
||||
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
||||
QSBNetworkManager.Instance.OnClientConnected += OnConnected;
|
||||
QSBNetworkManager.Instance.OnClientDisconnected += OnDisconnected;
|
||||
QSBNetworkManager.Instance.OnClientErrorThrown += OnClientError;
|
||||
QSBNetworkManager.singleton.OnClientConnected += OnConnected;
|
||||
QSBNetworkManager.singleton.OnClientDisconnected += OnDisconnected;
|
||||
QSBNetworkManager.singleton.OnClientErrorThrown += OnClientError;
|
||||
}
|
||||
|
||||
private void OnSceneLoaded(OWScene oldScene, OWScene newScene, bool isUniverse)
|
||||
@ -273,7 +273,7 @@ namespace QSB.Menus
|
||||
|
||||
private void Disconnect()
|
||||
{
|
||||
QSBNetworkManager.Instance.StopHost();
|
||||
QSBNetworkManager.singleton.StopHost();
|
||||
SetButtonActive(DisconnectButton.gameObject, false);
|
||||
|
||||
Locator.GetSceneMenuManager().pauseMenu._pauseMenu.EnableMenu(false);
|
||||
@ -286,7 +286,7 @@ namespace QSB.Menus
|
||||
|
||||
private void Host()
|
||||
{
|
||||
QSBNetworkManager.Instance.StartHost();
|
||||
QSBNetworkManager.singleton.StartHost();
|
||||
SetButtonActive(DisconnectButton, true);
|
||||
SetButtonActive(HostButton, false);
|
||||
SetButtonActive(QuitButton, false);
|
||||
@ -313,8 +313,8 @@ namespace QSB.Menus
|
||||
{
|
||||
var address = ((PopupInputMenu)IPPopup).GetInputText();
|
||||
|
||||
QSBNetworkManager.Instance.networkAddress = address;
|
||||
QSBNetworkManager.Instance.StartClient();
|
||||
QSBNetworkManager.singleton.networkAddress = address;
|
||||
QSBNetworkManager.singleton.StartClient();
|
||||
|
||||
if (QSBSceneManager.CurrentScene == OWScene.TitleScreen)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ namespace QSB.OrbSync.WorldObjects
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
Object.Instantiate(QSBNetworkManager.Instance.OrbPrefab).SpawnWithServerAuthority();
|
||||
Object.Instantiate(QSBNetworkManager.singleton.OrbPrefab).SpawnWithServerAuthority();
|
||||
}
|
||||
|
||||
StartDelayedReady();
|
||||
|
@ -151,7 +151,7 @@ namespace QSB
|
||||
{
|
||||
DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
|
||||
Port = config.GetSettingsValue<int>("port");
|
||||
if (QSBNetworkManager.Instance != null)
|
||||
if (QSBNetworkManager.singleton != null)
|
||||
{
|
||||
// todo QSBNetworkManager.Instance.networkPort = Port;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace QSB
|
||||
{
|
||||
public class QSBNetworkManager : NetworkManager
|
||||
{
|
||||
public static QSBNetworkManager Instance => (QSBNetworkManager)singleton;
|
||||
public static QSBNetworkManager singleton => (QSBNetworkManager)NetworkManager.singleton;
|
||||
|
||||
public event Action OnNetworkManagerReady;
|
||||
public event Action OnClientConnected;
|
||||
|
@ -42,7 +42,7 @@ namespace QSB
|
||||
|
||||
if (newScene == OWScene.TitleScreen && QSBCore.IsInMultiplayer)
|
||||
{
|
||||
QSBNetworkManager.Instance.StopHost();
|
||||
QSBNetworkManager.singleton.StopHost();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,8 @@ namespace QSB.RespawnSync
|
||||
=> QSBCore.UnityEvents.RunWhen(
|
||||
() => Locator.GetMarkerManager() != null,
|
||||
() => Init(newScene, inUniverse));
|
||||
QSBNetworkManager.Instance.OnClientConnected += OnConnected;
|
||||
QSBNetworkManager.Instance.OnClientDisconnected += OnDisconnected;
|
||||
QSBNetworkManager.singleton.OnClientConnected += OnConnected;
|
||||
QSBNetworkManager.singleton.OnClientDisconnected += OnDisconnected;
|
||||
}
|
||||
|
||||
private void OnConnected()
|
||||
|
@ -33,7 +33,7 @@ namespace QSB.SatelliteSync
|
||||
{
|
||||
Instance = this;
|
||||
QSBSceneManager.OnUniverseSceneLoaded += OnSceneLoaded;
|
||||
QSBNetworkManager.Instance.OnClientConnected += OnConnected;
|
||||
QSBNetworkManager.singleton.OnClientConnected += OnConnected;
|
||||
}
|
||||
|
||||
public void OnDestroy() => QSBSceneManager.OnUniverseSceneLoaded -= OnSceneLoaded;
|
||||
|
@ -88,7 +88,7 @@ namespace QSB.ShipSync
|
||||
DebugLog.ToConsole($"Error - Tried to spawn ship, but LocalPlayer's TransformSync is null!", MessageType.Error);
|
||||
}
|
||||
|
||||
Instantiate(QSBNetworkManager.Instance.ShipPrefab).SpawnWithServerAuthority();
|
||||
Instantiate(QSBNetworkManager.singleton.ShipPrefab).SpawnWithServerAuthority();
|
||||
}
|
||||
|
||||
QSBWorldSync.Init<QSBShipComponent, ShipComponent>();
|
||||
|
@ -44,7 +44,7 @@ namespace QSB.TornadoSync
|
||||
|
||||
private static void SpawnOccasional(OWRigidbody body, OWRigidbody refBody)
|
||||
{
|
||||
var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetRequiredComponent<OccasionalTransformSync>();
|
||||
var transformSync = Instantiate(QSBNetworkManager.singleton.OccasionalPrefab).GetRequiredComponent<OccasionalTransformSync>();
|
||||
transformSync.InitBodyIndexes(body, refBody);
|
||||
transformSync.gameObject.SpawnWithServerAuthority();
|
||||
}
|
||||
|
@ -60,10 +60,10 @@ namespace QSB.WorldSync
|
||||
|
||||
public static void Rebuild(OWScene scene)
|
||||
{
|
||||
if (!QSBNetworkManager.Instance.IsReady)
|
||||
if (!QSBNetworkManager.singleton.IsReady)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Tried to rebuild WorldObjects when Network Manager not ready! Building when ready...", MessageType.Warning);
|
||||
QSBCore.UnityEvents.RunWhen(() => QSBNetworkManager.Instance.IsReady, () => Rebuild(scene));
|
||||
QSBCore.UnityEvents.RunWhen(() => QSBNetworkManager.singleton.IsReady, () => Rebuild(scene));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user