- Jail chain now shows and hides itself at the appropriate times.

- Jail chain now syncs a lot more smoothly.
This commit is contained in:
2025-08-24 18:14:53 -04:00
parent 3c5f9842ec
commit b5dd078ee1
24 changed files with 2022 additions and 1225 deletions
+26 -17
View File
@@ -200,8 +200,10 @@ public class AudioManager : UdonSharpBehaviour
_MusicPlayer.loop = Loop;
if (_MusicPlayer.clip != null)
{
_MusicPlayer.volume = 1.0f;
_MusicPlayer.Play();
}
}
@@ -300,9 +302,11 @@ public class AudioManager : UdonSharpBehaviour
default: _SFXPlayer.clip = null; break;
}
_SFXPlayer.pitch = 1.0f;
_SFXPlayer.loop = false;
if (_SFXPlayer.clip != null)
{
_SFXPlayer.pitch = 1.0f;
_SFXPlayer.Play();
}
}
@@ -315,28 +319,31 @@ public class AudioManager : UdonSharpBehaviour
private void _PlayCrookInJail_Internal(AccusedCrook Crook)
{
_SFXPlayer.Stop();
_MusicPlayer.Stop();
_FadeOutMusic = false;
switch (Crook)
{
case AccusedCrook.Contessa: _SFXPlayer.clip = _CrookInJail_Contessa; break;
case AccusedCrook.DoubleTrouble: _SFXPlayer.clip = _CrookInJail_DoubleTrouble; break;
case AccusedCrook.EarthaBrute: _SFXPlayer.clip = _CrookInJail_EarthaBrute; break;
case AccusedCrook.Kneemoi: _SFXPlayer.clip = _CrookInJail_Kneemoi; break;
case AccusedCrook.PattyLarceny: _SFXPlayer.clip = _CrookInJail_PattyLarceny; break;
case AccusedCrook.Robocrook: _SFXPlayer.clip = _CrookInJail_Robocrook; break;
case AccusedCrook.SarahNade: _SFXPlayer.clip = _CrookInJail_SarahNade; break;
case AccusedCrook.TopGrunge: _SFXPlayer.clip = _CrookInJail_TopGrunge; break;
case AccusedCrook.VicTheSlick: _SFXPlayer.clip = _CrookInJail_VicTheSlick; break;
case AccusedCrook.WonderRat: _SFXPlayer.clip = _CrookInJail_WonderRat; break;
case AccusedCrook.Contessa: _MusicPlayer.clip = _CrookInJail_Contessa; break;
case AccusedCrook.DoubleTrouble: _MusicPlayer.clip = _CrookInJail_DoubleTrouble; break;
case AccusedCrook.EarthaBrute: _MusicPlayer.clip = _CrookInJail_EarthaBrute; break;
case AccusedCrook.Kneemoi: _MusicPlayer.clip = _CrookInJail_Kneemoi; break;
case AccusedCrook.PattyLarceny: _MusicPlayer.clip = _CrookInJail_PattyLarceny; break;
case AccusedCrook.Robocrook: _MusicPlayer.clip = _CrookInJail_Robocrook; break;
case AccusedCrook.SarahNade: _MusicPlayer.clip = _CrookInJail_SarahNade; break;
case AccusedCrook.TopGrunge: _MusicPlayer.clip = _CrookInJail_TopGrunge; break;
case AccusedCrook.VicTheSlick: _MusicPlayer.clip = _CrookInJail_VicTheSlick; break;
case AccusedCrook.WonderRat: _MusicPlayer.clip = _CrookInJail_WonderRat; break;
default: _SFXPlayer.clip = null; break;
default: _MusicPlayer.clip = null; break;
}
_SFXPlayer.pitch = 1.0f;
if (_SFXPlayer.clip != null)
_MusicPlayer.loop = false;
if (_MusicPlayer.clip != null)
{
_SFXPlayer.Play();
_MusicPlayer.volume = 1.0f;
_MusicPlayer.Play();
}
}
@@ -367,9 +374,11 @@ public class AudioManager : UdonSharpBehaviour
default: _SFXPlayer.clip = null; break;
}
_SFXPlayer.pitch = 1.0f;
_SFXPlayer.loop = false;
if (_SFXPlayer.clip != null)
{
_SFXPlayer.pitch = 1.0f;
_SFXPlayer.Play();
}
}
@@ -56,6 +56,8 @@ public class GameManagerRound2 : GameManagerBase
_JailChain.Initialise();
_JailPlayer.PlayVideo = false;
RequestSerialization();
base.InitialiseGameMode();
}
@@ -265,6 +267,8 @@ public class GameManagerRound2 : GameManagerBase
(HostCardRecoverTheLootEndInterface)GetHostCardInterface(RoundSegmentType.EndRecoverTheLoot);
EndRecoverTheLootInterface.HeaderUI.text = "END";
_JailChain.Show = true;
EnableInteraction("Go To The Map");
}
@@ -275,7 +279,9 @@ public class GameManagerRound2 : GameManagerBase
(HostCardBetweenRoundsInterface)GetHostCardInterface(RoundSegmentType.BetweenSegments);
Interface.HeaderUI.text = "Round is over.";
Interface.CommentUI.text = "Let's go to the map!";
_JailPlayer.PlayVideo = false;
_CaseManager.ContinueToRound3();
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All,
@@ -368,11 +374,16 @@ public class GameManagerRound2 : GameManagerBase
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlaySFX", SFXEventType.FogHorn);
SendCustomEventDelayedSeconds(nameof(PlayCrookInJail), 1.5f);
}
public void PlayCrookInJail()
{
_JailPlayer.PlayVideo = true;
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlayCrookInJail", _CaseManager.GetCrook());
SendCustomEventDelayedSeconds(nameof(HideJailChain), 1.5f);
}
public void HideJailChain()
{
_JailChain.Show = false;
}
public void PlayJailCallAfrica()
+188 -101
View File
@@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 8
Data: 9
- Name:
Entry: 7
Data:
@@ -185,13 +185,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _RingPivot
Data: _ChainHome
- Name: $v
Entry: 7
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _RingPivot
Data: _ChainHome
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
@@ -239,13 +239,13 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _RingGrabberHome
Data: _PullTarget
- Name: $v
Entry: 7
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _RingGrabberHome
Data: _PullTarget
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
@@ -293,19 +293,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _PullTarget
Data: _JailChainAnimator
- Name: $v
Entry: 7
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _PullTarget
Data: _JailChainAnimator
- Name: <UserType>k__BackingField
Entry: 9
Data: 8
Entry: 7
Data: 19|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: UnityEngine.Animator, UnityEngine.AnimationModule
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 8
Data: 19
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -320,73 +326,13 @@ MonoBehaviour:
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
Data: 2
- Name:
Entry: 7
Data: 20|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _ReturnSpeedMultiplier
- Name: $v
Entry: 7
Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ReturnSpeedMultiplier
- Name: <UserType>k__BackingField
Entry: 7
Data: 22|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 22
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 3
- Name:
Entry: 7
Data: 24|UnityEngine.SpaceAttribute, UnityEngine.CoreModule
Data: 21|UnityEngine.SpaceAttribute, UnityEngine.CoreModule
- Name: height
Entry: 4
Data: 8
@@ -395,16 +341,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 7
Data: 25|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
- Name: tooltip
Entry: 1
Data: Speed at which the chain returns to its neutral pose.
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 26|UnityEngine.SerializeField, UnityEngine.CoreModule
Data: 22|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
@@ -425,25 +362,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _PullChain
Data: _ReturnSpeedMultiplier
- Name: $v
Entry: 7
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _PullChain
Data: _ReturnSpeedMultiplier
- Name: <UserType>k__BackingField
Entry: 7
Data: 28|System.RuntimeType, mscorlib
Data: 24|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
Data: System.Single, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 28
Data: 24
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -455,13 +392,37 @@ MonoBehaviour:
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 25|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 3
- Name:
Entry: 7
Data: 26|UnityEngine.SpaceAttribute, UnityEngine.CoreModule
- Name: height
Entry: 4
Data: 8
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 27|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
- Name: tooltip
Entry: 1
Data: Speed at which the chain returns to its neutral pose.
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 28|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
@@ -479,25 +440,31 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _HasBeenActivated
Data: _Show
- Name: $v
Entry: 7
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _HasBeenActivated
Data: _Show
- Name: <UserType>k__BackingField
Entry: 9
Data: 28
Entry: 7
Data: 30|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Boolean, mscorlib
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 28
Data: 30
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
@@ -509,7 +476,127 @@ MonoBehaviour:
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
Data: 2
- Name:
Entry: 7
Data: 32|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data: 33|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _PullChain
- Name: $v
Entry: 7
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _PullChain
- Name: <UserType>k__BackingField
Entry: 9
Data: 30
- Name: <SystemType>k__BackingField
Entry: 9
Data: 30
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 36|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _HasBeenActivated
- Name: $v
Entry: 7
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _HasBeenActivated
- Name: <UserType>k__BackingField
Entry: 9
Data: 30
- Name: <SystemType>k__BackingField
Entry: 9
Data: 30
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 39|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
+28 -11
View File
@@ -12,27 +12,28 @@ public class JailChain : UdonSharpBehaviour
[SerializeField] private GameManagerRound2 _GameManager;
[Space]
[SerializeField] private Transform _ChainPivot;
[SerializeField] private Transform _RingPivot;
[SerializeField] private Transform _RingGrabberHome;
[SerializeField] private Transform _ChainHome;
[SerializeField] private Transform _PullTarget;
[Space]
[SerializeField] private Animator _JailChainAnimator;
[Space]
[Tooltip("Speed at which the chain returns to its neutral pose.")]
[SerializeField] private float _ReturnSpeedMultiplier = 5.0f;
private bool _PullChain = false;
private bool _HasBeenActivated = false;
[UdonSynced, FieldChangeCallback(nameof(Show))] private bool _Show = false;
[UdonSynced] private bool _PullChain = false;
[UdonSynced] private bool _HasBeenActivated = false;
void Update()
public override void PostLateUpdate()
{
if (_PullChain)
{
_RingPivot.transform.position = transform.position;
_ChainPivot.LookAt(transform);
if (!_HasBeenActivated && transform.localPosition.z < _PullTarget.transform.localPosition.z)
{
_HasBeenActivated = true;
RequestSerialization();
if (Networking.IsOwner(gameObject))
{
_GameManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlayInJailAnimation");
@@ -42,9 +43,11 @@ public class JailChain : UdonSharpBehaviour
else
{
transform.localPosition = Vector3.Lerp(transform.localPosition, Vector3.zero, Time.deltaTime * _ReturnSpeedMultiplier);
_RingPivot.transform.position = transform.position;
_ChainPivot.LookAt(transform);
}
_ChainPivot.LookAt(_ChainHome.transform);
base.PostLateUpdate();
}
public override void OnPickup()
@@ -68,7 +71,21 @@ public class JailChain : UdonSharpBehaviour
_HasBeenActivated = false;
transform.localPosition = Vector3.zero;
_RingPivot.transform.position = transform.position;
_ChainPivot.localRotation = Quaternion.identity;
Show = false;
RequestSerialization();
}
public bool Show
{
set
{
_Show = value;
_JailChainAnimator.SetBool("Show", _Show);
RequestSerialization();
}
get => _Show;
}
}
+3 -2
View File
@@ -42,13 +42,14 @@ public class RandomVideoPlayer : UdonSharpBehaviour
private void _StopVideo_Private()
{
transform.position = new Vector3(transform.position.x, 1000.0f, transform.position.z);
transform.position = new Vector3(transform.position.x, -1000.0f, transform.position.z);
VideoIndex = -1;
_VideoPlayer.Stop();
}
public override void OnVideoEnd()
{
transform.position = new Vector3(transform.position.x, 1000.0f, transform.position.z);
transform.position = new Vector3(transform.position.x, -1000.0f, transform.position.z);
PlayVideo = false;
base.OnVideoEnd();
}
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: BoneFollower
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 52ecc8a73071e8e40928c3609699fcf4,
serializedUdonProgramAsset: {fileID: 11400000, guid: ccbda9bf23e2f714c9226283c77a92e5,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: InteractToggle
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 873dfce61b1514e429c92e0d2fded7de,
serializedUdonProgramAsset: {fileID: 11400000, guid: 405e38d3dfb2f514daeed0e28fbb4864,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: PlayerModSetter
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: e81558796a212ab4d88e305e2010f24b,
serializedUdonProgramAsset: {fileID: 11400000, guid: f938e6c4ff027a74da405a1f9353fd2b,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: GlobalToggleObject
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 2fe8ced6184000f49bca526cd2c5891c,
serializedUdonProgramAsset: {fileID: 11400000, guid: c49c9265a3ef24642a6a4465d0a78872,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: MasterToggleObject
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: a2d01d9f36ac6df49831be249e48ecc4,
serializedUdonProgramAsset: {fileID: 11400000, guid: 04024a76ab1924042ba521e11cb76d91,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: TrackingDataFollower
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 1b89d4552983c0448a7389decec3b555,
serializedUdonProgramAsset: {fileID: 11400000, guid: 17f8fbbe6cc186d4f8dbb057b01a4ec2,
type: 2}
udonAssembly:
assemblyError:
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
m_Name: WorldAudioSettings
m_EditorClassIdentifier:
serializedUdonProgramAsset: {fileID: 11400000, guid: 994b559b0f158b4499f8937980ed8694,
serializedUdonProgramAsset: {fileID: 11400000, guid: 128d924a3066b7546b2d1c73e61006ab,
type: 2}
udonAssembly:
assemblyError: