mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-15 22:50:56 +00:00
remove GetSyncObject
This commit is contained in:
parent
74da562d70
commit
62f7b4e1f1
@ -34,7 +34,7 @@ namespace QSB.Animation.Player.Messages
|
||||
|
||||
public override void OnReceiveRemote()
|
||||
{
|
||||
var animationSync = QSBPlayerManager.GetSyncObject<AnimationSync>(PlayerId);
|
||||
var animationSync = QSBPlayerManager.GetPlayer(PlayerId).AnimationSync;
|
||||
if (animationSync == null)
|
||||
{
|
||||
return;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using QSB.Instruments;
|
||||
using QSB.Messaging;
|
||||
using QSB.Messaging;
|
||||
using QSB.Player;
|
||||
using QSB.WorldSync;
|
||||
using QuantumUNET.Transport;
|
||||
@ -39,7 +38,7 @@ namespace QSB.Animation.Player.Messages
|
||||
}
|
||||
|
||||
player.AnimationSync.SetAnimationType(Value);
|
||||
QSBPlayerManager.GetSyncObject<InstrumentsManager>(PlayerId).CheckInstrumentProps(Value);
|
||||
player.InstrumentsManager.CheckInstrumentProps(Value);
|
||||
}
|
||||
}
|
||||
}
|
@ -62,16 +62,15 @@ namespace QSB.Animation.Player.Patches
|
||||
__instance._animator.SetBool("UsingJetpack", isInZeroG && PlayerState.IsWearingSuit());
|
||||
if (__instance._justBecameGrounded)
|
||||
{
|
||||
var playerAnimationSync = QSBPlayerManager.LocalPlayer.AnimationSync;
|
||||
if (__instance._justTookFallDamage)
|
||||
{
|
||||
__instance._animator.SetTrigger("LandHard");
|
||||
new AnimationTriggerMessage(playerAnimationSync.PlayerId, "LandHard").Send();
|
||||
new AnimationTriggerMessage(QSBPlayerManager.LocalPlayerId, "LandHard").Send();
|
||||
}
|
||||
else
|
||||
{
|
||||
__instance._animator.SetTrigger("Land");
|
||||
new AnimationTriggerMessage(playerAnimationSync.PlayerId, "Land").Send();
|
||||
new AnimationTriggerMessage(QSBPlayerManager.LocalPlayerId, "Land").Send();
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,8 +127,7 @@ namespace QSB.Animation.Player.Patches
|
||||
}
|
||||
|
||||
__instance._animator.SetTrigger("Jump");
|
||||
var playerAnimationSync = QSBPlayerManager.LocalPlayer.AnimationSync;
|
||||
new AnimationTriggerMessage(playerAnimationSync.PlayerId, "Jump").Send();
|
||||
new AnimationTriggerMessage(QSBPlayerManager.LocalPlayerId, "Jump").Send();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -219,9 +219,7 @@ namespace QSB.Player
|
||||
Translator?.ChangeEquipState(TranslatorEquipped);
|
||||
ProbeLauncher?.ChangeEquipState(ProbeLauncherEquipped);
|
||||
Signalscope?.ChangeEquipState(SignalscopeEquipped);
|
||||
|
||||
QSBCore.UnityEvents.RunWhen(() => AnimationSync != null,
|
||||
() => QSBPlayerManager.GetSyncObject<AnimationSync>(PlayerId).SetSuitState(SuitedUp));
|
||||
AnimationSync.SetSuitState(SuitedUp);
|
||||
}
|
||||
|
||||
public void UpdateStatesFromObjects()
|
||||
|
@ -54,9 +54,6 @@ namespace QSB.Player
|
||||
public static bool PlayerExists(uint id) =>
|
||||
id is not (uint.MaxValue or 0) && PlayerList.Any(x => x.PlayerId == id);
|
||||
|
||||
public static T GetSyncObject<T>(uint id) where T : PlayerSyncObject =>
|
||||
GetPlayer(id).TransformSync.GetComponent<T>();
|
||||
|
||||
public static List<PlayerInfo> GetPlayersWithCameras(bool includeLocalCamera = true)
|
||||
{
|
||||
var cameraList = PlayerList.Where(x => x.Camera != null && x.PlayerId != LocalPlayerId).ToList();
|
||||
|
Loading…
Reference in New Issue
Block a user