Skip to content

Commit

Permalink
Replacing NetworkManger.Singleton with m_NetworkManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jabbacakes authored Aug 8, 2024
1 parent 3724772 commit 87745fd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/tutorials/get-started-with-ngo.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,18 @@ The `HelloWorldManager.cs` script accomplishes this menu within the `StartButton
```csharp
static void StartButtons()
{
if (GUILayout.Button("Host")) NetworkManager.Singleton.StartHost();
if (GUILayout.Button("Client")) NetworkManager.Singleton.StartClient();
if (GUILayout.Button("Server")) NetworkManager.Singleton.StartServer();
if (GUILayout.Button("Host")) m_NetworkManager.StartHost();
if (GUILayout.Button("Client")) m_NetworkManager.StartClient();
if (GUILayout.Button("Server")) m_NetworkManager.StartServer();
}

static void StatusLabels()
{
var mode = NetworkManager.Singleton.IsHost ?
"Host" : NetworkManager.Singleton.IsServer ? "Server" : "Client";
var mode = m_NetworkManager.IsHost ?
"Host" : m_NetworkManager.IsServer ? "Server" : "Client";

GUILayout.Label("Transport: " +
NetworkManager.Singleton.NetworkConfig.NetworkTransport.GetType().Name);
m_NetworkManager.NetworkConfig.NetworkTransport.GetType().Name);
GUILayout.Label("Mode: " + mode);
}
```
Expand Down Expand Up @@ -489,9 +489,9 @@ Because the `HelloWorldPlayer.cs` script handles the position NetworkVariable, t
```csharp
static void SubmitNewPosition()
{
if (GUILayout.Button(NetworkManager.Singleton.IsServer ? "Move" : "Request Position Change"))
if (GUILayout.Button(m_NetworkManager.IsServer ? "Move" : "Request Position Change"))
{
var playerObject = NetworkManager.Singleton.SpawnManager.GetLocalPlayerObject();
var playerObject = m_NetworkManager.SpawnManager.GetLocalPlayerObject();
var player = playerObject.GetComponent<HelloWorldPlayer>();
player.Move();
}
Expand Down

3 comments on commit 87745fd

@pzoghbi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who approved of this code?

@pzoghbi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Member instances replaced static instances inside static methods. It would be best if you reverted this commit.

@pzoghbi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.