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的更多相关文章

  1. unity3D技术之事件函数的执行顺序[转]

    unity3D技术之事件函数的执行顺序 转自http://www.yxkfw.com/?p=13703   在unity的脚本,有大量的脚本执行按照预先确定的顺序执行的事件函数.此执行顺序说明如下: ...

  2. [转]Unity3d之MonoBehaviour的可重写函数整理

    最近在学习Unity3d的知识.虽然有很多资料都有记录了,可是我为了以后自己复习的时候方便就记录下来吧!下面的这些函数在Unity3d程序开发中具有很重要的作用. Update 当MonoBehavi ...

  3. Unity3d之MonoBehaviour的可重写函数整理

    最近在学习Unity3d的知识.虽然有很多资料都有记录了,可是我为了以后自己复习的时候方便就记录下来吧!下面的这些函数在Unity3d程序开发中具有很重要的作用. Update 当MonoBehavi ...

  4. Unity3D脚本中文系列教程(十)

    http://dong2008hong.blog.163.com/blog/static/4696882720140312627682/?suggestedreading&wumii Unit ...

  5. Unity重要的函数

    Awake 当一个脚本实例被载入时Awake被调用. Start Start仅在Update函数第一次被调用前调用. Update 当MonoBehaviour启用时,其Update在每一帧被调用. ...

  6. Unity 生命周期

    原文翻译:            Execution Order of Event Functions            事件函数的执行顺序                        Edit ...

  7. unity3d 各功能的运行秩序,打回来,订购,的次数

    Update 当MonoBehaviour启用时,其Update在每一帧被调用. 仅调用一次(每帧) LateUpdate 当Behaviour启用时,  每帧调用一次: FixedUpdate 当M ...

  8. unity3D中重要函数

    Update 当MonoBehaviour启用时,其Update在每一帧被调用. LateUpdate 当Behaviour启用时,其 LateUpdate在每一帧被调用. FixedUpdate 当 ...

  9. Unity3D中的函数方法及解释

    一.刷新函数 Update 当MonoBehaviour启用时,其Update在每一帧被调用. LateUpdate 当Behaviour启用时,其LateUpdate在每一帧被调用. FixedUp ...

随机推荐

  1. 数据库数据格式化之Kettle Spoon

    前言 现在的数据库种类越来越多,数据库备份的格式也越来越复杂,所以数据格式化一直是一个老生常谈的问题.据库备份文件格式那么多,既有SQL的,也有BAK的,还有TXT的等.数据库种类也有很多,MySQL ...

  2. .NET Out Of Memory Exception - Used 1.3GB but have 16GB installed

    I am getting an Out Of Memory exception in my c# application when the memory usage for the applicati ...

  3. SpringBoot打jar包问题

    原文:https://jingyan.baidu.com/article/6f2f55a11d6e09b5b93e6c9e.html 当你使用springBoot进行打包的时候,这篇经验会帮助到你的. ...

  4. rest api上传和下载文件

    rest api上传和下载文件 function FileToString(AFileName: string): string; var LMemoryStream: TMemoryStream; ...

  5. 【python】python读写文件,都不乱码

    读是按照文本的编码方式读取,写是按照文本的编码方式追加 import chardet fileName = 'E:/2/采集数据_pswf12_180大0小35750_20181206.txt' # ...

  6. LinkedList、Stack、Queue、PriorityQueue的总结

    1.这几种容器的特点 都是按照顺序来存储元素. 取元素的时候的不同点: LinkedList:按照下标随意取元素 Stack:后进先出取元素 Queue:先进先出取元素 PriorityQueue:按 ...

  7. Java 集合系列之 Vector详细介绍(源码解析)和使用示例

    Vector简介 Vector 是矢量队列,它是JDK1.0版本添加的类.继承于AbstractList,实现了List, RandomAccess, Cloneable这些接口. Vector 继承 ...

  8. 唐顿庄园第一至五季/全集Downton Abbey迅雷下载

    本季Downton Abbey 1(2010)看点:ITV古装剧剧<唐顿庄园>由曾因<高斯福德庄园>而荣获奥斯卡的金牌编剧Julian Fellowes一手打造,明星云集的演员 ...

  9. command line subversion for windows

    安装 Slik SVN 之后,进入dos, 输入svn help,所有的命令和相关的信息都出来了   相关的svn命令:log.export等,可以搜索相应的文章: svn常用命令 svn log - ...

  10. Fragment Transactions & Activity State Loss

    转自:http://www.androiddesignpatterns.com/2013/08/fragment-transaction-commit-state-loss.html The foll ...