Files
AppleHillsProduction/Assets/Scripts/UI/Tutorial/DivingTutorial.cs

64 lines
1.4 KiB
C#

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();
}
}