Camera.OnPostRender 在渲染之后

function OnPostRender () : 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.

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

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;
}
最后修改:2011年3月7日 Monday 15:58

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。