mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Add impostor toggle to debugger
This commit is contained in:
1 file changed
+22
-1
@@ -65,7 +65,27 @@ namespace Reactor.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
if (TutorialManager.InstanceExists && GUILayout.Button("Spawn a dummy", new Il2CppReferenceArray<GUILayoutOption>(0)))
|
||||
if (TutorialManager.InstanceExists && PlayerControl.LocalPlayer)
|
||||
{
|
||||
var data = PlayerControl.LocalPlayer.Data;
|
||||
|
||||
var newIsImpostor = GUILayout.Toggle(data.IsImpostor, "Is Impostor", new Il2CppReferenceArray<GUILayoutOption>(0));
|
||||
if (data.IsImpostor != newIsImpostor)
|
||||
{
|
||||
if (newIsImpostor)
|
||||
{
|
||||
PlayerControl.LocalPlayer.RpcSetInfected(new[]
|
||||
{
|
||||
data
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerControl.LocalPlayer.RemoveInfected();
|
||||
}
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Spawn a dummy", new Il2CppReferenceArray<GUILayoutOption>(0)))
|
||||
{
|
||||
var playerControl = Instantiate(TutorialManager.Instance.PlayerPrefab);
|
||||
var i = playerControl.PlayerId = (byte) GameData.Instance.GetAvailableId();
|
||||
@@ -81,6 +101,7 @@ namespace Reactor.Debugger
|
||||
playerControl.SetSkin(i % (uint) HatManager.Instance.AllSkins.Count);
|
||||
GameData.Instance.RpcSetTasks(playerControl.PlayerId, new byte[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (PlayerControl.LocalPlayer)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user