mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 03:19:23 +00:00
Propper game events
Ragdoll body parts grab
This commit is contained in:
parent
8bead6a764
commit
84c255660e
12 changed files with 279 additions and 20 deletions
|
@ -1,5 +1,6 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.Util.AssetFiltering;
|
||||
using ABI_RC.Systems.GameEventSystem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
@ -17,6 +18,8 @@ namespace ml_prm
|
|||
GameEvents.Init(HarmonyInstance);
|
||||
WorldHandler.Init();
|
||||
|
||||
CVRGameEventSystem.Player.OnJoinEntity.AddListener(this.OnRemotePlayerCreated);
|
||||
|
||||
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
|
||||
MelonLoader.MelonCoroutines.Start(WaitForWhitelist());
|
||||
}
|
||||
|
@ -28,6 +31,8 @@ namespace ml_prm
|
|||
if(m_localController != null)
|
||||
UnityEngine.Object.Destroy(m_localController);
|
||||
m_localController = null;
|
||||
|
||||
CVRGameEventSystem.Player.OnJoinEntity.RemoveListener(this.OnRemotePlayerCreated);
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator WaitForLocalPlayer()
|
||||
|
@ -50,5 +55,11 @@ namespace ml_prm
|
|||
}
|
||||
l_hashSet.Add(typeof(RagdollToggle));
|
||||
}
|
||||
|
||||
void OnRemotePlayerCreated(CVRPlayerEntity p_player)
|
||||
{
|
||||
if((p_player != null) && (p_player.PuppetMaster != null))
|
||||
p_player.PuppetMaster.gameObject.AddComponent<RemoteGestureHandler>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue