ARDoor/ARDoors/Assets/Zion/Scripts/CamController.cs

38 lines
826 B
C#

using Cinemachine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CamController : MonoBehaviour
{
/// <summary>
/// 静物球
/// </summary>
public GameObject paperBall;
/// <summary>
/// 是否越墙
/// </summary>
public bool isEnter;
private void OnTriggerEnter(Collider other)
{
if(other.tag.Equals("Wall"))
{
if(isEnter)
{
paperBall.SetActive(false);
isEnter = false;
}
else
{
paperBall.SetActive(true);
isEnter = true;
}
}
//else if(other.tag.Equals("Door"))
//{
// paperBall.SetActive(true);
// isEnter = false;
//}
}
}