Tweaked intro timeline to deactivate if not used
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user