From 3ea161c987cc710d63523dc81e983de971d6063f Mon Sep 17 00:00:00 2001 From: Michal Pikulski Date: Mon, 27 Oct 2025 14:55:42 +0100 Subject: [PATCH] Auto vs Manual progression of the tutorial --- Assets/Scripts/UI/Tutorial/DivingTutorial.cs | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/UI/Tutorial/DivingTutorial.cs b/Assets/Scripts/UI/Tutorial/DivingTutorial.cs index 7d6a3328..0fe35ad3 100644 --- a/Assets/Scripts/UI/Tutorial/DivingTutorial.cs +++ b/Assets/Scripts/UI/Tutorial/DivingTutorial.cs @@ -11,8 +11,15 @@ namespace UI.Tutorial { public class DivingTutorial : MonoBehaviour, ITouchInputConsumer { + public enum ProgressType + { + Manual, // Wait for player tap after animation loop + Auto // Automatically progress after animation loop + } + private StateMachine _stateMachine; public bool playTutorial; + [SerializeField] private ProgressType progressType = ProgressType.Manual; // gating for input until current state's animation finishes first loop [SerializeField] private GameObject tapPrompt; @@ -107,7 +114,8 @@ namespace UI.Tutorial _canAcceptInput = allow; if (tapPrompt != null) { - tapPrompt.SetActive(allow); + // Only show tap prompt in Manual mode + tapPrompt.SetActive(allow && progressType == ProgressType.Manual); } } @@ -201,7 +209,19 @@ namespace UI.Tutorial yield return null; } - SetInputEnabled(true); + // After first loop completes, handle based on progress type + if (progressType == ProgressType.Auto) + { + // Auto mode: immediately progress to next state + _stateMachine.Next(true); + SetupInputGateForCurrentState(); + } + else + { + // Manual mode: enable input and wait for player tap + SetInputEnabled(true); + } + _waitLoopCoroutine = null; } }