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

47 lines
795 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 ( == true)
{
if (first == false)
return;
.SetActive(true);
first = false;
}
else {
.SetActive(true);
}
}
private void OnTriggerExit(Collider other)
{
.SetActive(false);
}
}