IsRenderingOrNot

using UnityEngine;
using System.Collections;

public class Rendering : MonoBehaviour {

public bool isRendering = false;//是否被摄像机渲染
private float lastTime = 0;//
private float curtTime = 0;//
void Update()
{
isRendering = curtTime != lastTime ? true : false;
lastTime = curtTime;
}
void OnWillRenderObject()
{
// if (Camera.current.name == Camera.main.name)//是需要渲染的摄像机
// {
curtTime = Time.time;
Debug.Log("isRendering");
//}


}

}

posted @ 2016-08-31 11:42  Fei非非  阅读(193)  评论(0编辑  收藏  举报