Too many changes

This commit is contained in:
SDraw 2024-10-05 15:42:32 +03:00
parent 45557943c4
commit a22e5992d0
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
72 changed files with 1064 additions and 927 deletions

View file

@ -1,32 +1,34 @@
using ABI_RC.Core.Player;
using UnityEngine;
namespace ml_pam
{
public class PickupArmMovement : MelonLoader.MelonMod
{
ArmMover m_localMover = null;
ArmMover m_mover = null;
public override void OnInitializeMelon()
{
Settings.Init();
GameEvents.Init(HarmonyInstance);
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
MelonLoader.MelonCoroutines.Start(WaitForRootLogic());
}
System.Collections.IEnumerator WaitForLocalPlayer()
System.Collections.IEnumerator WaitForRootLogic()
{
while(PlayerSetup.Instance == null)
while(ABI_RC.Core.RootLogic.Instance == null)
yield return null;
while(ABI_RC.Core.Player.PlayerSetup.Instance == null)
yield return null;
m_localMover = PlayerSetup.Instance.gameObject.AddComponent<ArmMover>();
m_mover = new GameObject("[PickupArmMovement]").AddComponent<ArmMover>();
}
public override void OnDeinitializeMelon()
{
if(m_localMover != null)
UnityEngine.Object.Destroy(m_localMover);
m_localMover = null;
if(m_mover != null)
Object.Destroy(m_mover.gameObject);
m_mover = null;
}
}
}