early prototype D level

This commit is contained in:
Dominik
2023-06-12 14:07:20 +02:00
parent 9e9c85a51e
commit 21a1bae027
10 changed files with 7593 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class keyWhenPressed : MonoBehaviour
{
public GameObject objectToActivate;
public ButtonDOne ButtonDOne;
public ButtonDOne ButtonDTwo;
public ButtonDOne ButtonDThree;
private bool isActivated;
private void Awake()
{
// Disable the object by default
objectToActivate.SetActive(false);
}
private void Update()
{
bool eins = ButtonDOne.einsAn;
bool zwei = ButtonDTwo.zweiAn;
bool drei = ButtonDThree.dreiAn;
// Check if all three conditions are true and the object is not yet activated
if (eins && zwei && drei && !isActivated)
{
// Activate the object
objectToActivate.SetActive(true);
isActivated = true;
}
}
}