E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/Interactive objects/TriggerActive_control.cs

48 lines
803 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TriggerActive_control : MonoBehaviour
{
public GameObject ;
public bool ;
private bool first=true;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter(Collider other)
{
if (first == false)
return;
.SetActive(true);
first = false;
}
private void OnTriggerExit(Collider other)
{
.SetActive(false);
if ( == false)
{
first = true;
}
}
}