OnBecameVisible和OnBecameInvisible ,OnWillRenderObject

news/2024/7/5 19:58:26

http://www.cnblogs.com/wonderKK/p/4112304.html

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 只有在所挂物体(不包括子物体)有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可以用于只需要在物体可见时才进行的计算。


http://www.niftyadmin.cn/n/1958827.html

相关文章

django-第一个项目

1、下载后解压 python setup.py install 2、设置path set PATHd:\python27\scripts;%path% 3、生成初步构架 F:\pro>django-admin.py startproject adcschat 4、构架内容: urls将url模式映射到你应用程序上 setting包含了项目的默认设置 manage同这个dja…

最赚钱的行业和公司排行榜(verified 版本)

【外资证券】:代表性公司:高盛、中金、摩根士丹利等单位第一年收入:50-80万左右(中金第一年基本工资25万,奖金35万,福利10万)五年后收入:300万左右工作时间量:每天18个小…

NGUI版虚拟摇杆joystick

http://blog.csdn.net/anyuanlzh/article/details/40107577 下面是我用nui实现的一个虚拟摇杆。 1,示图 2、代码如下,都有比较详细的注释,就不说明了。 [csharp] view plaincopyusing UnityEngine; using System.Collections; using Syst…

java核心技术之 ArrayList应用 【职员薪水管理系统】

职员薪水管理系统需求如下: /*** author:kevin* date:20110-7-15* function:use ArrayList to build a system of EmployeeSalaryMangement ,* the system is useful for manager to add new employeeinformation,delete employeeinformation,* update employeeinfo…

结合存储过程开发数据库应用程

存储过程提供了数据驱动应用程序中的许多优点。利用存储过程,数据库操作可以封装在单个命令中,为获取最佳性能而进行优化并通过附加的安全性得到增强;利用存储过程,还可以获得sql语句的重用,节省开发时间。在.NET中&am…

python-操作postgresql

PostgreSQL 至少有至少 3 个 Python 接口程序可以访问 PosgreSQL: psycopg, PyPgSQL 和 PyGreSQL. 第四个, PoPy, 现在已经被废弃(2003年, 它贡献出自己的代码, 与PygreSQL整合在一起). 这三个接口程序各有长处, 各有缺点, 根据实践结果选择使用哪个接口是个好主意. 多亏他们…

C++数据库操作并生成ini文件。

我最近在学习C,刚学了半个月吧,带我的导师就开始让我写一个利用c来开发个工具,这可难坏我了,起初以为根本弄不出来。但是经过不停的修改,导师的带领最终还是弄出来了。明白做技术的在不懈的努力下,肯定会把结果弄出来的…

将世界坐标转成NGUI坐标

http://blog.csdn.net/anyuanlzh/article/details/40072051 将世界坐标转成NGUI坐标&#xff0c;这个中间需要一个屏幕坐标&#xff0c;可参考如下代码&#xff1a; [html] view plaincopy/// <summary> /// 将世界坐标转成UI坐标 /// </summary> /// <pa…