Tweaked intro timeline to deactivate if not used

This commit is contained in:
journaliciouz
2025-12-14 17:39:55 +01:00
parent 313d27f7f2
commit 1f344efb08
4 changed files with 355 additions and 146 deletions

View File

@@ -3,6 +3,7 @@ using Core;
using Core.Lifecycle;
using UnityEngine.Playables;
using Input;
using Unity.Cinemachine;
public class LevelIntroDirector : ManagedBehaviour
{
@@ -14,17 +15,21 @@ public class LevelIntroDirector : ManagedBehaviour
internal override void OnSceneReady()
{
base.OnSceneReady();
introPlayableDirector = GetComponent<PlayableDirector>();
introPlayableDirector.stopped += IntroTimelineStopped;
if (playOnSceneReady)
{
introPlayableDirector = GetComponent<PlayableDirector>();
introPlayableDirector.stopped += IntroTimelineStopped;
PlayIntroTimeline();
}
else { gameObject.SetActive(false); }
}
private void IntroTimelineStopped(PlayableDirector director)
{
InputManager.Instance.SetInputMode(InputMode.Game);
introPlayableDirector.stopped -= IntroTimelineStopped;
gameObject.SetActive(false);
}
public void PlayIntroTimeline()