Auto vs Manual progression of the tutorial
This commit is contained in:
@@ -11,8 +11,15 @@ namespace UI.Tutorial
|
|||||||
{
|
{
|
||||||
public class DivingTutorial : MonoBehaviour, ITouchInputConsumer
|
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;
|
private StateMachine _stateMachine;
|
||||||
public bool playTutorial;
|
public bool playTutorial;
|
||||||
|
[SerializeField] private ProgressType progressType = ProgressType.Manual;
|
||||||
|
|
||||||
// gating for input until current state's animation finishes first loop
|
// gating for input until current state's animation finishes first loop
|
||||||
[SerializeField] private GameObject tapPrompt;
|
[SerializeField] private GameObject tapPrompt;
|
||||||
@@ -107,7 +114,8 @@ namespace UI.Tutorial
|
|||||||
_canAcceptInput = allow;
|
_canAcceptInput = allow;
|
||||||
if (tapPrompt != null)
|
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;
|
yield return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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);
|
SetInputEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
_waitLoopCoroutine = null;
|
_waitLoopCoroutine = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user