From a66e6bbda25b99b5b3d6d6c4200aace3880b57b3 Mon Sep 17 00:00:00 2001 From: Arshvir Goraya <113562877+ArshvirGoraya@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:52:17 -0400 Subject: [PATCH 1/2] auto-dismount after OnPreTransition --- Assets/Scripts/Game/TransportManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Game/TransportManager.cs b/Assets/Scripts/Game/TransportManager.cs index 8ab4596224..3b6ef5e620 100644 --- a/Assets/Scripts/Game/TransportManager.cs +++ b/Assets/Scripts/Game/TransportManager.cs @@ -199,7 +199,8 @@ void Start() neighClip = dfAudioSource.GetAudioClip((int)horseSound); // Init event listener for transitions. - PlayerEnterExit.OnPreTransition += new PlayerEnterExit.OnPreTransitionEventHandler(HandleTransition); + PlayerEnterExit.OnTransitionInterior += HandleTransition; + PlayerEnterExit.OnTransitionDungeonInterior += HandleTransition; } // Handle interior/exterior transition events by setting transport mode to Foot. From 04272f0a3583aca864917fb0c6c28fcbf27f9d25 Mon Sep 17 00:00:00 2001 From: Arshvir Goraya <113562877+ArshvirGoraya@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:37:52 -0400 Subject: [PATCH 2/2] Changed auto-dismount back & created PreviousTransportMode --- Assets/Scripts/Game/TransportManager.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Game/TransportManager.cs b/Assets/Scripts/Game/TransportManager.cs index 3b6ef5e620..ad09510f53 100644 --- a/Assets/Scripts/Game/TransportManager.cs +++ b/Assets/Scripts/Game/TransportManager.cs @@ -50,6 +50,10 @@ public TransportModes TransportMode get { return mode; } set { UpdateMode(value); } } + public TransportModes PreviousTransportMode + { + get { return previousTransportMode; } + } /// True when player is on foot. public bool IsOnFoot @@ -142,6 +146,9 @@ private bool HasShip() #region Private Fields private TransportModes mode = TransportModes.Foot; + + private TransportModes previousTransportMode = TransportModes.Foot; + private PlayerPositionData_v1 boardShipPosition; // Holds the player position from before boarding a ship. @@ -199,8 +206,7 @@ void Start() neighClip = dfAudioSource.GetAudioClip((int)horseSound); // Init event listener for transitions. - PlayerEnterExit.OnTransitionInterior += HandleTransition; - PlayerEnterExit.OnTransitionDungeonInterior += HandleTransition; + PlayerEnterExit.OnPreTransition += new PlayerEnterExit.OnPreTransitionEventHandler(HandleTransition); } // Handle interior/exterior transition events by setting transport mode to Foot. @@ -331,6 +337,7 @@ void OnGUI() private void UpdateMode(TransportModes transportMode) { // Update the transport mode and stop any riding sounds playing. + previousTransportMode = mode; mode = transportMode; if (ridingAudioSource.isPlaying) ridingAudioSource.Stop();