Reformat code

This commit is contained in:
js6pak committed 2022-08-30 19:49:49 +02:00
1 parent c2047b033e
commit 5004ac8d5b
52 files changed
+2126 -2180

No files matched your search

+31 -32
View File
@@ -8,52 +8,51 @@ using UnhollowerBaseLib.Attributes;
using UnityEngine;
using Random = UnityEngine.Random;
namespace Reactor.Example
namespace Reactor.Example;
[BepInAutoPlugin("gg.reactor.Example")]
[BepInProcess("Among Us.exe")]
[BepInDependency(ReactorPlugin.Id)]
public partial class ExamplePlugin : BasePlugin
{
[BepInAutoPlugin("gg.reactor.Example")]
[BepInProcess("Among Us.exe")]
[BepInDependency(ReactorPlugin.Id)]
public partial class ExamplePlugin : BasePlugin
public override void Load()
{
public override void Load()
this.AddComponent<ExampleComponent>();
}
[RegisterInIl2Cpp]
public class ExampleComponent : MonoBehaviour
{
public ExampleComponent(IntPtr ptr) : base(ptr)
{
this.AddComponent<ExampleComponent>();
}
[RegisterInIl2Cpp]
public class ExampleComponent : MonoBehaviour
private void Update()
{
public ExampleComponent(IntPtr ptr) : base(ptr)
if (AmongUsClient.Instance && PlayerControl.LocalPlayer)
{
}
private void Update()
{
if (AmongUsClient.Instance && PlayerControl.LocalPlayer)
if (Input.GetKeyDown(KeyCode.F3))
{
if (Input.GetKeyDown(KeyCode.F3))
{
var name = PlayerControl.LocalPlayer.Data.PlayerName;
Rpc<ExampleRpc>.Instance.Send(new ExampleRpc.Data($"Send: from {name}"));
var name = PlayerControl.LocalPlayer.Data.PlayerName;
Rpc<ExampleRpc>.Instance.Send(new ExampleRpc.Data($"Send: from {name}"));
if (!AmongUsClient.Instance.AmHost)
{
Rpc<ExampleRpc>.Instance.SendTo(AmongUsClient.Instance.HostId, new ExampleRpc.Data($"SendTo: from {name} to host"));
}
}
if (Input.GetKeyDown(KeyCode.F4))
if (!AmongUsClient.Instance.AmHost)
{
RpcSay(PlayerControl.LocalPlayer, "Hello from method rpc", Random.value, PlayerControl.LocalPlayer);
Rpc<ExampleRpc>.Instance.SendTo(AmongUsClient.Instance.HostId, new ExampleRpc.Data($"SendTo: from {name} to host"));
}
}
if (Input.GetKeyDown(KeyCode.F4))
{
RpcSay(PlayerControl.LocalPlayer, "Hello from method rpc", Random.value, PlayerControl.LocalPlayer);
}
}
}
}
[MethodRpc((uint) CustomRpcCalls.MethodRpcExample)]
public static void RpcSay(PlayerControl player, string text, float number, PlayerControl testPlayer)
{
Logger<ExamplePlugin>.Info($"{player.Data.PlayerName} text: {text} number: {number} testPlayer: {testPlayer.NetId}");
}
[MethodRpc((uint) CustomRpcCalls.MethodRpcExample)]
public static void RpcSay(PlayerControl player, string text, float number, PlayerControl testPlayer)
{
Logger<ExamplePlugin>.Info($"{player.Data.PlayerName} text: {text} number: {number} testPlayer: {testPlayer.NetId}");
}
}