CustomRpc SendTo

This commit is contained in:
js6pak committed 2021-01-22 11:03:14 +01:00
1 parent 58b28d8e9c
commit 3299ffc071
4 files changed
+15 -4

No files matched your search

+2 -1
View File
@@ -35,10 +35,11 @@ namespace Reactor.Example
private void Update()
{
if (Input.GetKeyDown(KeyCode.F3))
if (Input.GetKeyDown(KeyCode.F3) && AmongUsClient.Instance && PlayerControl.LocalPlayer)
{
Plugin.Log.LogWarning("Sending example rpc");
PlayerControl.LocalPlayer.Send<ExampleRpc>(new ExampleRpc.Data("Cześć :)"));
PlayerControl.LocalPlayer.SendTo<ExampleRpc>(AmongUsClient.Instance.HostId, new ExampleRpc.Data("host :O"));
}
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ namespace Reactor.Example
}
}
public override RpcLocalHandling LocalHandling => RpcLocalHandling.Before;
public override RpcLocalHandling LocalHandling => RpcLocalHandling.None;
public override void Write(MessageWriter writer, Data data)
{