Added 2 minigames

This commit is contained in:
2026-02-21 14:56:19 +01:00
parent 4a84e729f3
commit 9defaa314a
93 changed files with 62846 additions and 26 deletions

28
Assets/Scripts/keyslot.cs Normal file
View File

@@ -0,0 +1,28 @@
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
public class KeySlot : MonoBehaviour, IDropHandler
{
public string correctKeyID;
public void OnDrop(PointerEventData eventData)
{
DraggableKey key = eventData.pointerDrag.GetComponent<DraggableKey>();
if (key != null)
{
if (key.keyID == correctKeyID)
{
key.transform.position = transform.position;
key.enabled = false;
KeyminigameManager.Instance.CheckWin();
}
else
{
KeyminigameManager.Instance.Fail();
}
}
}
}