early prototype D level
This commit is contained in:
33
Assets/AssetsFORELLE/Script/keyWhenPressed.cs
Normal file
33
Assets/AssetsFORELLE/Script/keyWhenPressed.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user