sdraw_mods_cvr/ml_pmc/Main.cs
SDraw 85925a7072
Custom event classes for patched methods
Update to LeapCSharp 6.15.0
2024-04-27 00:23:03 +03:00

33 lines
903 B
C#

using ABI_RC.Core.Player;
namespace ml_pmc
{
public class PlayerMovementCopycat : MelonLoader.MelonMod
{
PoseCopycat m_localCopycat = null;
public override void OnInitializeMelon()
{
Settings.Init();
ModUi.Init();
GameEvents.Init(HarmonyInstance);
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
}
public override void OnDeinitializeMelon()
{
if(m_localCopycat != null)
UnityEngine.Object.Destroy(m_localCopycat);
m_localCopycat = null;
}
System.Collections.IEnumerator WaitForLocalPlayer()
{
while(PlayerSetup.Instance == null)
yield return null;
m_localCopycat = PlayerSetup.Instance.gameObject.AddComponent<PoseCopycat>();
}
}
}