Implemented Diving tutorial
This commit is contained in:
63
Assets/Scripts/UI/Tutorial/DivingTutorial.cs
Normal file
63
Assets/Scripts/UI/Tutorial/DivingTutorial.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user