Skip to content

updating code samples that uses outdated version of CurrentPlayer.ReadOnlyTags #1386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mppm/player-tags/target-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This example uses [Netcode for GameObjects](https://docs-multiplayer.unity3d.com
:::

```csharp
using System.Linq;
using Unity.Netcode;
using UnityEngine;
using Unity.Multiplayer.Playmode;
Expand Down
5 changes: 3 additions & 2 deletions mppm/player-tags/target-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This example uses the [Network Simulator](https://docs-multiplayer.unity3d.com/t
```csharp
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Unity.Multiplayer.Playmode;
using Unity.Multiplayer.Tools.NetworkSimulator.Runtime;
Expand All @@ -29,11 +30,11 @@ public class NetworkSimulation : MonoBehaviour
gameObject.AddComponent<NetworkSimulator>();

var connectionPreset = NetworkSimulatorPresets.None;
if (CurrentPlayer.ReadOnlyTags() == "FastNetwork")
if (CurrentPlayer.ReadOnlyTags().Contains("FastNetwork"))
{
connectionPreset = NetworkSimulatorPresets.HomeBroadband;
}
else if (CurrentPlayer.ReadOnlyTags() == "SlowNetwork")
else if (CurrentPlayer.ReadOnlyTags().Contains("SlowNetwork"))
{
connectionPreset = NetworkSimulatorPresets.Mobile2_5G;
}
Expand Down
1 change: 1 addition & 0 deletions mppm/player-tags/target-team.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The following script automatically sets a [NetworkVariable](https://docs-multipl
A Player with a `Red` tag automatically sets the `Team` NetworkVariable to `Red`. A Player with a `Blue` tag automatically sets the `Team` NetworkVariable to `Blue`.

```csharp
using System.Linq;
using Unity.Netcode;
using UnityEngine;
using Unity.Multiplayer.Playmode;
Expand Down