mirror of
https://github.com/zoriya/Magical-Garden.git
synced 2025-12-06 07:16:15 +00:00
Adding a start menu UI code.
This commit is contained in:
@@ -13,7 +13,9 @@ public class InventoryManager : MonoBehaviour
|
|||||||
public Tilemap selectorMap;
|
public Tilemap selectorMap;
|
||||||
public TileBase[] selector;
|
public TileBase[] selector;
|
||||||
public TextMeshProUGUI turnCount;
|
public TextMeshProUGUI turnCount;
|
||||||
|
public GameObject StartUI;
|
||||||
public AudioSource music;
|
public AudioSource music;
|
||||||
|
private bool started = false;
|
||||||
|
|
||||||
[Space]
|
[Space]
|
||||||
public GameObject[] slots;
|
public GameObject[] slots;
|
||||||
@@ -64,6 +66,12 @@ public class InventoryManager : MonoBehaviour
|
|||||||
}
|
}
|
||||||
draggedPosition = -1;
|
draggedPosition = -1;
|
||||||
}
|
}
|
||||||
|
if(!started && Input.anyKeyDown)
|
||||||
|
{
|
||||||
|
started = true;
|
||||||
|
StartUI.SetActive(false);
|
||||||
|
GetComponent<Mission>().Initiate();
|
||||||
|
}
|
||||||
if (Input.GetKeyDown(KeyCode.R))
|
if (Input.GetKeyDown(KeyCode.R))
|
||||||
{
|
{
|
||||||
ClearBoard();
|
ClearBoard();
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ public class Mission : MonoBehaviour {
|
|||||||
TreeItem[] items;
|
TreeItem[] items;
|
||||||
public GameObject WinUI;
|
public GameObject WinUI;
|
||||||
public GameObject LooseUI;
|
public GameObject LooseUI;
|
||||||
private void Start()
|
|
||||||
|
public void Initiate()
|
||||||
{
|
{
|
||||||
items = GetComponent<InventoryManager>().items;
|
items = GetComponent<InventoryManager>().items;
|
||||||
if(items == null)
|
if(items == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user