判断物体是否在视角内
public var isRendering:boolean=false;
private var lastTime:float=0;
private var curtTime:float=0;
function Update()
{
isRendering=curtTime!=lastTime?true:false;
lastTime=curtTime;
}
//如果物体可见,每个相机都会调用OnWillRenderObject。
//http://game.ceeger.com/Script/Camera/Camera.OnWillRenderObject.html
function OnWillRenderObject()
{
curtTime=Time.time;
}