61 lines
1.8 KiB
C#
61 lines
1.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class RoomInspection : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
ExtendedFlycam.Inst.peiDianShiD.SetActive(false);
|
|
ExtendedFlycam.Inst.jiFangD.SetActive(false);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void OnTriggerEnter(Collider other)
|
|
{
|
|
//Debug.Log(other.gameObject.name);
|
|
if (other.gameObject != Camera.main.gameObject)
|
|
return;
|
|
if (ExtendedFlycam.Inst.room == ExtendedFlycam.Room.None)
|
|
{
|
|
if (ExtendedFlycam.Inst.jiFang[1].activeInHierarchy && ExtendedFlycam.Inst.peiDianShi[1].activeInHierarchy)
|
|
{
|
|
ExtendedFlycam.Inst.peiDianShiD.SetActive(true);
|
|
ExtendedFlycam.Inst.jiFangD.SetActive(true);
|
|
}
|
|
|
|
}
|
|
else if (ExtendedFlycam.Inst.room == ExtendedFlycam.Room.»ú·¿)
|
|
{
|
|
if (ExtendedFlycam.Inst.jiFang[1].activeInHierarchy)
|
|
{
|
|
ExtendedFlycam.Inst.peiDianShiD.SetActive(false);
|
|
ExtendedFlycam.Inst.jiFangD.SetActive(true);
|
|
}
|
|
}
|
|
else if (ExtendedFlycam.Inst.room == ExtendedFlycam.Room.ÅäµçÊÒ)
|
|
{
|
|
if (ExtendedFlycam.Inst.peiDianShi[1].activeInHierarchy)
|
|
{
|
|
ExtendedFlycam.Inst.peiDianShiD.SetActive(true);
|
|
ExtendedFlycam.Inst.jiFangD.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void OnTriggerExit(Collider other)
|
|
{
|
|
//Debug.Log(other.gameObject.name);
|
|
if (other.gameObject != Camera.main.gameObject)
|
|
return;
|
|
ExtendedFlycam.Inst.peiDianShiD.SetActive(false);
|
|
ExtendedFlycam.Inst.jiFangD.SetActive(false);
|
|
}
|
|
}
|