找回密码
 注册帐号

扫一扫,访问微社区

camera.onpostrender 在渲染之后

2015-1-4 03:47| 发布者: 杨炎| 查看: 3208| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: camera.onpostrender 在渲染之后functiononpostrender() : voiddescription描述onpostrender is called after a camera has finished rendering the scene.onpostrender 在相机渲染场景之后调用。this message is se ...

camera.onpostrender 在渲染之后

functiononpostrender() : void

description描述

onpostrender is called after a camera has finished rendering the scene.

onpostrender 在相机渲染场景之后调用。

this message is sent to all scripts attached to the camera.

这个消息被发送到所有附加在相机的脚本

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

private bool revertfogstate = false;

void onprerender() {

revertfogstate =rendersettings.fog;

rendersettings.fog= enabled;

}

void onpostrender() {

rendersettings.fog= revertfogstate;

}

}

// this script lets you enable/disable fog per camera.

//这个脚本让你在每个相机开启/禁用雾效

// by enabling or disabling the script in the title of the inspector

//在检视面板开启或禁用这个脚本

// you can turn fog on or off per camera.

//在每个相机可以开启/禁用雾效

private var revertfogstate = false;

function onprerender () {

revertfogstate = rendersettings.fog;

rendersettings.fog= enabled;

}

function onpostrender () {

rendersettings.fog= revertfogstate;

}

相关阅读

文章点评
相关文章