Implemented Diving tutorial
This commit is contained in:
8
Assets/Scripts/UI/Tutorial.meta
Normal file
8
Assets/Scripts/UI/Tutorial.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b98977013f83da24a8e4aa17926525c6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
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();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Tutorial/DivingTutorial.cs.meta
Normal file
2
Assets/Scripts/UI/Tutorial/DivingTutorial.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0f21d12fb6a50242b483dbdc3a6a1df
|
||||
Reference in New Issue
Block a user