Rework of base interactables and managed behaviors

This commit is contained in:
Michal Pikulski
2025-11-04 11:11:27 +01:00
committed by Michal Pikulski
parent 00e1746ac4
commit f88bd0e2c9
60 changed files with 11175 additions and 1340 deletions

View File

@@ -1,6 +1,6 @@
using System.Collections;
using Bootstrap;
using Core;
using Core.Lifecycle;
using Core.SaveLoad;
using Input;
using Pixelplacement;
@@ -9,7 +9,7 @@ using UnityEngine;
namespace UI.Tutorial
{
public class DivingTutorial : MonoBehaviour, ITouchInputConsumer
public class DivingTutorial : ManagedBehaviour, ITouchInputConsumer
{
public enum ProgressType
{
@@ -27,18 +27,14 @@ namespace UI.Tutorial
private bool _canAcceptInput;
private Coroutine _waitLoopCoroutine;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
BootCompletionService.RegisterInitAction(InitializeTutorial);
public override int ManagedAwakePriority => 200; // Tutorial runs late, after other systems
protected override void OnManagedAwake()
{
// Ensure prompt is hidden initially (even before tutorial initialization)
if (tapPrompt != null)
tapPrompt.SetActive(false);
}
void InitializeTutorial()
{
if (playTutorial && !SaveLoadManager.Instance.currentSaveData.playedDivingTutorial)
{
// TODO: Possibly do it better, but for now just mark tutorial as played immediately
@@ -221,7 +217,7 @@ namespace UI.Tutorial
// Manual mode: enable input and wait for player tap
SetInputEnabled(true);
}
_waitLoopCoroutine = null;
}
}