Skip to content

Commit b87e1ea

Browse files
committed
Kick Out button for editor
Kick Out button
1 parent 25d1703 commit b87e1ea

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Diff for: Assets/Editor/MultiplayerManagerEditor.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public override void OnInspectorGUI()
143143
if (GUILayout.Button(muteButtonLabel))
144144
{
145145
bool newMuteState = !currentMuteState;
146-
MultiplayerManager.m_Instance.MutePlayerForAll(newMuteState, playerId);
146+
multiplayerManager.MutePlayerForAll(newMuteState, playerId);
147147
muteStates[playerId] = newMuteState;
148148
EditorUtility.SetDirty(target);
149149
}
@@ -154,11 +154,21 @@ public override void OnInspectorGUI()
154154
if (GUILayout.Button(viewButtonLabel))
155155
{
156156
bool newViewState = !currentViewState;
157-
MultiplayerManager.m_Instance.ToggleUserViewOnlyMode(newViewState, playerId);
157+
multiplayerManager.ToggleUserViewOnlyMode(newViewState, playerId);
158158
viewOnlyStates[playerId] = newViewState;
159159
EditorUtility.SetDirty(target);
160160
}
161161

162+
// ** Kick Out button (only if room owner) **
163+
if (multiplayerManager.IsUserRoomOwner())
164+
{
165+
if (GUILayout.Button("Kick Out"))
166+
{
167+
multiplayerManager.KickPlayerOut(playerId);
168+
EditorUtility.SetDirty(target);
169+
}
170+
}
171+
162172
EditorGUILayout.EndHorizontal();
163173
}
164174
}

0 commit comments

Comments
 (0)