Podium pedestal height is now synced across clients.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,8 @@ public class PlayerPodium : UdonSharpBehaviour
|
||||
[UdonSynced, FieldChangeCallback(nameof(ShowScoreCard))] private bool _ShowScoreCard = false;
|
||||
[UdonSynced, FieldChangeCallback(nameof(FlashScoreboard))] private bool _FlashScoreboard = false;
|
||||
|
||||
[UdonSynced, FieldChangeCallback(nameof(PedestalHeight))] private float _PedestalHeight = 0.0f;
|
||||
|
||||
[UdonSynced, FieldChangeCallback(nameof(EnableOwnershipTransfer))] private bool _EnableOwnershipTransfer = true;
|
||||
|
||||
[Space]
|
||||
@@ -129,11 +131,8 @@ public class PlayerPodium : UdonSharpBehaviour
|
||||
|
||||
private void AdjustPedestalHeight(VRCPlayerApi Player)
|
||||
{
|
||||
_Pedestal.transform.localPosition = new Vector3(
|
||||
_Pedestal.transform.localPosition.x,
|
||||
-Player.GetAvatarEyeHeightAsMeters(),
|
||||
_Pedestal.transform.localPosition.z
|
||||
);
|
||||
PedestalHeight = Player.GetAvatarEyeHeightAsMeters();
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
[NetworkCallable]
|
||||
@@ -370,6 +369,21 @@ public class PlayerPodium : UdonSharpBehaviour
|
||||
get => _FlashScoreboard;
|
||||
}
|
||||
|
||||
private float PedestalHeight
|
||||
{
|
||||
set
|
||||
{
|
||||
_PedestalHeight = value;
|
||||
_Pedestal.transform.localPosition = new Vector3(
|
||||
_Pedestal.transform.localPosition.x,
|
||||
-_PedestalHeight,
|
||||
_Pedestal.transform.localPosition.z
|
||||
);
|
||||
}
|
||||
get => _PedestalHeight;
|
||||
}
|
||||
|
||||
|
||||
private bool EnableOwnershipTransfer
|
||||
{
|
||||
set
|
||||
|
||||
Reference in New Issue
Block a user