mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 19:39:21 +00:00
Update to build 2024r174ex2
This commit is contained in:
parent
d537cab9ba
commit
4eda3ff4e4
7 changed files with 579 additions and 592 deletions
|
@ -1,29 +1,30 @@
|
|||
using ABI.CCK.Components;
|
||||
using ABI_RC.Systems.Movement;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ml_prm
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
class GravityInfluencer : MonoBehaviour
|
||||
{
|
||||
Rigidbody m_rigidBody = null;
|
||||
PhysicsInfluencer m_physicsInfluencer = null;
|
||||
bool m_activeGravity = true;
|
||||
|
||||
void Start()
|
||||
{
|
||||
m_rigidBody = this.GetComponent<Rigidbody>();
|
||||
m_physicsInfluencer = this.GetComponent<PhysicsInfluencer>();
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
m_rigidBody.useGravity = false;
|
||||
if(m_activeGravity && ((m_physicsInfluencer == null) || !m_physicsInfluencer.enableInfluence || !m_physicsInfluencer.GetSubmerged()))
|
||||
m_rigidBody.AddForce(BetterBetterCharacterController.Instance.GravityResult.AppliedGravity * m_rigidBody.mass);
|
||||
}
|
||||
|
||||
public void SetActiveGravity(bool p_state) => m_activeGravity = p_state;
|
||||
}
|
||||
}
|
||||
using ABI.CCK.Components;
|
||||
using ABI_RC.Systems.Gravity;
|
||||
using ABI_RC.Systems.Movement;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ml_prm
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
class GravityInfluencer : MonoBehaviour
|
||||
{
|
||||
Rigidbody m_rigidBody = null;
|
||||
PhysicsInfluencer m_physicsInfluencer = null;
|
||||
bool m_activeGravity = true;
|
||||
|
||||
void Start()
|
||||
{
|
||||
m_rigidBody = this.GetComponent<Rigidbody>();
|
||||
m_physicsInfluencer = this.GetComponent<PhysicsInfluencer>();
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
m_rigidBody.useGravity = false;
|
||||
if(m_activeGravity && ((m_physicsInfluencer == null) || !m_physicsInfluencer.enableInfluence || !m_physicsInfluencer.GetSubmerged()))
|
||||
m_rigidBody.AddForce(BetterBetterCharacterController.Instance.GravityResult.AppliedGravity * m_rigidBody.mass);
|
||||
}
|
||||
|
||||
public void SetActiveGravity(bool p_state) => m_activeGravity = p_state;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue