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;
}
Page last updated: 2011-3-7