ButtonsMemoryMinigame #28
@@ -2,6 +2,14 @@ using UnityEngine;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public enum GameState
|
||||||
|
{
|
||||||
|
Idle,
|
||||||
|
ShowingSequance,
|
||||||
|
PlayerTurn,
|
||||||
|
GameOver
|
||||||
|
}
|
||||||
|
|
||||||
public class ButtonsMinigame : MonoBehaviour
|
public class ButtonsMinigame : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Light[] lights;
|
public Light[] lights;
|
||||||
@@ -9,6 +17,7 @@ public class ButtonsMinigame : MonoBehaviour
|
|||||||
public float glowDuration = 0.4f;
|
public float glowDuration = 0.4f;
|
||||||
public float gapBetween = 0.15f;
|
public float gapBetween = 0.15f;
|
||||||
private int playerStep = 0;
|
private int playerStep = 0;
|
||||||
|
private GameState state = GameState.Idle;
|
||||||
private List<int> sequence = new List<int>();
|
private List<int> sequence = new List<int>();
|
||||||
|
|
||||||
void GenerateSequence()
|
void GenerateSequence()
|
||||||
@@ -39,6 +48,10 @@ public class ButtonsMinigame : MonoBehaviour
|
|||||||
StartCoroutine(PlaySequence());
|
StartCoroutine(PlaySequence());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetState(GameState newState)
|
||||||
|
{
|
||||||
|
state = newState;
|
||||||
|
}
|
||||||
public void OnButtonClicked(int buttonIndex)
|
public void OnButtonClicked(int buttonIndex)
|
||||||
{
|
{
|
||||||
Debug.Log("Clicked : " + buttonIndex);
|
Debug.Log("Clicked : " + buttonIndex);
|
||||||
|
|||||||
Reference in New Issue
Block a user