You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.1 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class opendoor : MonoBehaviour
{
public GameObject gg;
public GameObject ll;
private bool cc = false;
void Start()
{
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.E))
{
Debug.Log(cc);
if(cc) {
this.gg.SetActive(false);
this.GetComponent<BoxCollider>().isTrigger = true;
ll.SetActive(true);
}
}
}
private void OnCollisionEnter(Collision collision)
{
cc = true;
Debug.Log(collision.gameObject.name);
}
private void OnCollisionExit(Collision collision)
{
cc = false;
Debug.Log(cc);
}
private void OnTriggerEnter(Collider other)
{
Debug.Log("trigger enter");
}
private void OnTriggerStay(Collider other)
{
Debug.Log(other.gameObject.name);
}
private void OnTriggerExit(Collider other)
{
Debug.Log("trigger exit!!!!!!!!!!!!!!!!!");
}
}