Implemented Diving tutorial

This commit is contained in:
2025-10-15 15:58:19 +02:00
parent 19a1a2da51
commit 5f46c963b5
21 changed files with 16175 additions and 28 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b98977013f83da24a8e4aa17926525c6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
using UnityEngine;
using Pixelplacement;
using Minigames.DivingForPictures;
using Input;
using UnityEngine.Events;
public class DivingTutorial : MonoBehaviour, ITouchInputConsumer
{
private StateMachine stateMachine;
public DivingGameManager divingGameManager;
public bool playTutorial;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
if (playTutorial==true)
{
InitializeTutorial();
}
else { RemoveTutorial(); }
}
void InitializeTutorial()
{
stateMachine = GetComponentInChildren<StateMachine>();
divingGameManager.Pause();
InputManager.Instance.RegisterOverrideConsumer(this);
stateMachine.OnLastStateExited.AddListener(RemoveTutorial);
}
void RemoveTutorial()
{
Debug.Log("Remove me!");
Destroy(gameObject);
InputManager.Instance.UnregisterOverrideConsumer(this);
divingGameManager.DoResume();
}
public void OnTap(Vector2 position)
{
stateMachine.Next(true);
}
public void OnHoldStart(Vector2 position)
{
throw new System.NotImplementedException();
}
public void OnHoldMove(Vector2 position)
{
throw new System.NotImplementedException();
}
public void OnHoldEnd(Vector2 position)
{
throw new System.NotImplementedException();
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c0f21d12fb6a50242b483dbdc3a6a1df