From ba52bbd8285e48cb9560b809e8ea3d2d464cd6be Mon Sep 17 00:00:00 2001 From: bottlefish <781230111@qq.com> Date: Sun, 15 Jun 2025 21:26:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9timeline=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Yarn/FP_Day1_begin/Day1_begin.yarn | 2 +- Assets/Scripts/SubWay/OutsideCenter.cs | 30 ++++--------------- Assets/Scripts/SubWay/OutsideYarnCommand.cs | 4 +-- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/Assets/Resources/Yarn/FP_Day1_begin/Day1_begin.yarn b/Assets/Resources/Yarn/FP_Day1_begin/Day1_begin.yarn index 52cfc3d52..fddbdb301 100644 --- a/Assets/Resources/Yarn/FP_Day1_begin/Day1_begin.yarn +++ b/Assets/Resources/Yarn/FP_Day1_begin/Day1_begin.yarn @@ -155,7 +155,7 @@ position: 250,200 <> <> <> -<> +<> <> <> <> diff --git a/Assets/Scripts/SubWay/OutsideCenter.cs b/Assets/Scripts/SubWay/OutsideCenter.cs index da0c19d3c..babcbe6db 100644 --- a/Assets/Scripts/SubWay/OutsideCenter.cs +++ b/Assets/Scripts/SubWay/OutsideCenter.cs @@ -19,38 +19,20 @@ namespace AibisDream public void PlayTimeline(string timelinePath) { - StartCoroutine(PlayTimelineCoroutine(timelinePath)); + StartCoroutine(PlayTimelineCoroutine()); } public void PlayTimelineAsync(string timelinePath) { - var timeline = Resources.Load(timelinePath); - if (timeline != null) - { - director.playableAsset = timeline; - director.Play(); - } - else - { - Debug.LogError($"Timeline not found at path: {timelinePath}"); - } + director.Play(); } - public IEnumerator PlayTimelineCoroutine(string timelinePath) + public IEnumerator PlayTimelineCoroutine() { - var timeline = Resources.Load(timelinePath); - if (timeline != null) + director.Play(); + while (director.state == PlayState.Playing) { - director.playableAsset = timeline; - director.Play(); - while (director.state == PlayState.Playing) - { - yield return null; - } - } - else - { - Debug.LogError($"Timeline not found at path: {timelinePath}"); + yield return null; } } } diff --git a/Assets/Scripts/SubWay/OutsideYarnCommand.cs b/Assets/Scripts/SubWay/OutsideYarnCommand.cs index 544e8674b..267f98835 100644 --- a/Assets/Scripts/SubWay/OutsideYarnCommand.cs +++ b/Assets/Scripts/SubWay/OutsideYarnCommand.cs @@ -6,9 +6,9 @@ namespace AibisDream public static class OutsideYarnCommand { [YarnCommand("outside_play_timeline")] - public static IEnumerator PlayTimeline(string timelinePath) + public static IEnumerator PlayTimeline() { - yield return OutsideCenter.Instance.PlayTimelineCoroutine(timelinePath); + yield return OutsideCenter.Instance.PlayTimelineCoroutine(); } [YarnCommand("outside_play_timeline_nowait")]