mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
LuaNetworkVariables: idk
This commit is contained in:
parent
db07d53971
commit
fe768029eb
19 changed files with 1680 additions and 0 deletions
58
LuaNetworkVariables/Main.cs
Normal file
58
LuaNetworkVariables/Main.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.LuaNetVars;
|
||||
|
||||
public class LuaNetVarsMod : MelonMod
|
||||
{
|
||||
internal static MelonLogger.Instance Logger;
|
||||
|
||||
#region Melon Preferences
|
||||
|
||||
|
||||
#endregion Melon Preferences
|
||||
|
||||
#region Melon Events
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
Logger = LoggerInstance;
|
||||
|
||||
ApplyPatches(typeof(Patches.LuaScriptFactory_Patches));
|
||||
ApplyPatches(typeof(Patches.CVRSyncHelper_Patches));
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
// if (Input.GetKeyDown(KeyCode.F1))
|
||||
// {
|
||||
// PlayerSetup.Instance.DropProp("be0b5acc-a987-48dc-a28b-62bd912fe3a0");
|
||||
// }
|
||||
//
|
||||
// if (Input.GetKeyDown(KeyCode.F2))
|
||||
// {
|
||||
// GameObject go = new("TestSyncedObject");
|
||||
// go.AddComponent<TestSyncedObject>();
|
||||
// }
|
||||
}
|
||||
|
||||
#endregion Melon Events
|
||||
|
||||
#region Melon Mod Utilities
|
||||
|
||||
private void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Melon Mod Utilities
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue