Skip to content

Commit

Permalink
chore: updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
momintlh committed Nov 21, 2024
1 parent ad1377c commit aa608a4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8987662522597341863, guid: 1b30fa3a265114a45a7e23165a20aecc, type: 3}
propertyPath: mockMode
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8987662522597341863, guid: 1b30fa3a265114a45a7e23165a20aecc, type: 3}
propertyPath: insertCoinCaller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public void AddPlayer(PlayroomKit.Player player)
/// <summary>
/// Remove player from the game, called when the player leaves / closes the game.
/// </summary>
[MonoPInvokeCallback(typeof(Action<string>))]
private static void RemovePlayer(string playerID)
{
if (PlayerDict.TryGetValue(playerID, out GameObject player))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ private void Start()
_playroomKit.OnPlayerJoin(AddPlayer);

_playroomKit.RpcRegister("one", ((data, player) => { Debug.LogWarning("One Event Called"); }));

_playroomKit.RpcRegister("two", ((data, player) => { Debug.LogWarning("two Event Called"); }));
_playroomKit.RpcRegister("one", ((data, player) => { Debug.LogWarning("One Event Called With a diff callback"); }));


_playroomKit.RpcRegister("one",
((data, player) => { Debug.LogWarning("One Event Called With a diff callback"); }));
}, () => { Debug.Log("OnDisconnect callback"); });
}

Expand Down Expand Up @@ -102,14 +102,18 @@ private void AddPlayer(PlayroomKit.Player player)
playerJoined = true;
player.OnQuit(RemovePlayer);
}

private static void RemovePlayer(string playerID)
{
if (PlayerDict.TryGetValue(playerID, out var player))
{
PlayerDict.Remove(playerID);
playerGameObjects.Remove(player);
Destroy(player);

foreach (var (key, value) in PlayerDict) Debug.Log($"player {key} is still in the room");

Debug.Log(playerID + " has left the room!");
}
else
{
Expand Down
6 changes: 0 additions & 6 deletions ProjectSettings/EditorBuildSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 0
path: Assets/Scenes/Lobby.unity
guid: 27215d4ccddeb6d49af03911dd97f9b1
- enabled: 0
path: Assets/PlayroomKit/Examples/2d-platformer/2d-platformer.unity
guid: cf82eec4c654cf44b89cec2a91afebd5
- enabled: 1
path: Assets/PlayroomKit/Examples/discord-activity/discord-activity.unity
guid: bb7ef8e4a67f3fb46b78e5d95a6858a7
- enabled: 0
path: Assets/Scenes/topdown.unity
guid: 490247da3cf48784ab657a183ba059d1
- enabled: 0
path: Assets/PlayroomKit/Examples/package-showcase/showcase.unity
guid: 85c9af77ae006408ab24500b953a9035
Expand Down

0 comments on commit aa608a4

Please sign in to comment.