码迷,mamicode.com
首页 > 其他好文 > 详细

OnBecameVisible和OnBecameInvisible ,OnWillRenderObject

时间:2014-11-21 12:23:34      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:des   style   http   io   ar   color   sp   strong   on   

 

OnBecameVisible 和 OnBecameInvisible ,OnWillRenderObject 只有在所挂物体(不包括子物体)有render才有效

//可见
private void OnBecameVisible()
{
_isVisible = true;
}
//不可见
private void OnBecameInvisible()
{
_isVisible = false;
}

 

MonoBehaviour.OnBecameVisible 当可见

 

function OnBecameVisible () : void

Description描述

OnBecameVisible is called when the renderer became visible by any camera.

当renderer(渲染器)在任何相机上可见时调用OnBecameVisible。

This message is sent to all scripts attached to the renderer. OnBecameVisible and OnBecameInvisible is useful to avoid computations that are only necessary when the object is visible.

这个消息发送到所有附在渲染器的脚本上。OnBecameVisible 和 OnBecameInvisible可以用于只需要在物体可见时才进行的计算。

OnBecameVisible和OnBecameInvisible ,OnWillRenderObject

标签:des   style   http   io   ar   color   sp   strong   on   

原文地址:http://www.cnblogs.com/wonderKK/p/4112304.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!