- 最后登录
- 2019-12-2
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 34660
- 纳金币
- 38268
- 精华
- 111
|
判断物体是否在相机中渲染的代码:- using UnityEngine;
- using System.Collections;
- public class NewBehaviourScript : MonoBehaviour {
- public bool isRendering=false;
- private float lastTime=0;
- private float curtTime=0;
- void Update (){
- isRendering=curtTime!=lastTime?true:false;
- lastTime=curtTime;
- }
- void OnWillRenderObject (){
- curtTime=Time.time;
- }
- }
复制代码 |
|