diff --git a/Assets/Scripts/Pal3/Actor/HuaYingController.cs b/Assets/Scripts/Pal3/Actor/HuaYingController.cs index 20e545930..2caddc50c 100644 --- a/Assets/Scripts/Pal3/Actor/HuaYingController.cs +++ b/Assets/Scripts/Pal3/Actor/HuaYingController.cs @@ -22,7 +22,7 @@ public sealed class HuaYingController : FlyingActorController, private const float ROTATION_SPEED = 10f; private const float ROTATION_SYNCING_DISTANCE = 2f; private const float FOLLOW_TARGET_MIN_DISTANCE = 1f; - private const float FOLLOW_TARGET_FLY_SPEED_CHANEG_DISTANCE = 8f; + private const float FOLLOW_TARGET_FLY_SPEED_CHANGE_DISTANCE = 8f; private const float FOLLOW_TARGET_MAX_DISTANCE = 15f; private const float FOLLOW_TARGET_X_OFFSET = 0.8f; private const float FOLLOW_TARGET_Y_OFFSET = -0.8f; @@ -127,10 +127,10 @@ private void LateUpdate() } // Increase fly speed if the distance is greater than a threshold - var flySpeed = distanceToTarget > FOLLOW_TARGET_FLY_SPEED_CHANEG_DISTANCE ? MaxFlySpeed : DefaultFlySpeed; + var flySpeed = distanceToTarget > FOLLOW_TARGET_FLY_SPEED_CHANGE_DISTANCE ? MaxFlySpeed : DefaultFlySpeed; _actorActionController.PerformAction( - Vector3.Distance(myNewPosition, transform.position) < FOLLOW_TARGET_FLY_SPEED_CHANEG_DISTANCE - 1f + Vector3.Distance(myNewPosition, transform.position) < FOLLOW_TARGET_FLY_SPEED_CHANGE_DISTANCE - 1f ? _actor.GetMovementAction(MovementMode.Walk) : _actor.GetMovementAction(MovementMode.Run)); diff --git a/Assets/Scripts/Pal3/Actor/SkeletalAnimationActorActionController.cs b/Assets/Scripts/Pal3/Actor/SkeletalAnimationActorActionController.cs index bafbe46e5..174156d0e 100644 --- a/Assets/Scripts/Pal3/Actor/SkeletalAnimationActorActionController.cs +++ b/Assets/Scripts/Pal3/Actor/SkeletalAnimationActorActionController.cs @@ -94,7 +94,7 @@ public override void PerformAction(string actionName, movFile = _resourceProvider.GetGameResourceFile(movFilePath); textureProvider = _resourceProvider.CreateTextureResourceProvider( - Utility.GetRelativeDirectoryPath(movFilePath)); + Utility.GetRelativeDirectoryPath(mtlFilePath)); } catch (Exception ex) { diff --git a/Assets/Scripts/Pal3/GameSystem/DialogueManager.cs b/Assets/Scripts/Pal3/GameSystem/DialogueManager.cs index e9bcb5aa8..9f33afd9e 100644 --- a/Assets/Scripts/Pal3/GameSystem/DialogueManager.cs +++ b/Assets/Scripts/Pal3/GameSystem/DialogueManager.cs @@ -276,7 +276,7 @@ private IEnumerator RenderDialogueAndWaitAsync(string text, _dialogueCanvasGroup.enabled = true; _isSkipDialogueRequested = false; - yield return StartDialogueAnimationAsync(true); + yield return PlayDialogueBackgroundPopAnimationAsync(true); _isSkipDialogueRequested = false; // Ignore skip request during dialogue rendering animation foreach (var dialogue in GetSubDialoguesAsync(text)) @@ -302,7 +302,7 @@ private IEnumerator RenderDialogueAndWaitAsync(string text, _totalTimeUsedBeforeSkippingTheLastDialogue = timer.Elapsed.TotalSeconds; } - yield return StartDialogueAnimationAsync(false); + yield return PlayDialogueBackgroundPopAnimationAsync(false); ResetUI(); @@ -311,7 +311,7 @@ private IEnumerator RenderDialogueAndWaitAsync(string text, onFinished?.Invoke(); } - private IEnumerator StartDialogueAnimationAsync(bool showDialogue) + private IEnumerator PlayDialogueBackgroundPopAnimationAsync(bool showDialogue) { const float yOffset = DIALOGUE_SHOW_HIDE_ANIMATION_Y_OFFSET; Transform dialogueCanvasGroupTransform = _dialogueCanvasGroup.transform; diff --git a/Assets/Scripts/Pal3/Script/PalScriptRunner.cs b/Assets/Scripts/Pal3/Script/PalScriptRunner.cs index a2eb4fe79..400e0b229 100644 --- a/Assets/Scripts/Pal3/Script/PalScriptRunner.cs +++ b/Assets/Scripts/Pal3/Script/PalScriptRunner.cs @@ -119,25 +119,6 @@ private PalScriptRunner(PalScriptType scriptType, CommandExecutorRegistry.Instance.Register(this); } - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (!_isDisposed) - { - if (disposing) - { - CommandExecutorRegistry.Instance.UnRegister(this); - _scriptDataReader.Dispose(); - } - _isDisposed = true; - } - } - public bool Update(float deltaTime) { var canExecute = true; @@ -242,6 +223,30 @@ private void SetVariableValue(int variableName, int value) } } + ~PalScriptRunner() + { + Dispose(disposing: false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (!_isDisposed) + { + if (disposing) + { + CommandExecutorRegistry.Instance.UnRegister(this); + _scriptDataReader.Dispose(); + } + _isDisposed = true; + } + } + public void Execute(ScriptVarSetValueCommand command) { if (!_isExecuting) return;