34 lines
599 B
C#
34 lines
599 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 当前物体是否在相机渲染范围内
|
|
/// </summary>
|
|
public class ObjVisableInCam : MonoBehaviour
|
|
{
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
#region 可见性判断
|
|
|
|
public bool IsVisableInCamera { get; private set; }
|
|
|
|
private void OnBecameVisible() { IsVisableInCamera = true; }
|
|
|
|
private void OnBecameInvisible() { IsVisableInCamera = false; }
|
|
|
|
#endregion
|
|
}
|