mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
31 lines
589 B
C#
31 lines
589 B
C#
using Mirror;
|
|
using QSB.Utility;
|
|
using QSB.Utility.VariableSync;
|
|
|
|
namespace QSB.Animation.Player.Thrusters;
|
|
|
|
[UsedInUnityProject]
|
|
public class JetpackAccelerationSync : NetworkBehaviour
|
|
{
|
|
public Vector3VariableSyncer AccelerationVariableSyncer;
|
|
|
|
private ThrusterModel _thrusterModel;
|
|
|
|
public void Init(ThrusterModel model) => _thrusterModel = model;
|
|
|
|
public void Update()
|
|
{
|
|
if (isLocalPlayer)
|
|
{
|
|
SyncLocalAccel();
|
|
}
|
|
}
|
|
|
|
private void SyncLocalAccel()
|
|
{
|
|
if (_thrusterModel != null)
|
|
{
|
|
AccelerationVariableSyncer.Value = _thrusterModel.GetLocalAcceleration();
|
|
}
|
|
}
|
|
} |