Unity学习笔记(七)—— 调整屏幕的亮度、饱和度和对比度

在本次学习中,需要实现的是一个简易的屏幕后处理特效,调整屏幕的亮度、饱和度和对比度。

在跟随书实现效果之前,因为不了解脚本相关知识,在实现前阅读官方文档了解基本知识,并且脚本需要具备一定的C#知识,所以C#也将一起学习。

        创建基础的脚本,用于检测条件是否满足与处理材质

using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
[RequireComponent (typeof(Camera))]
public class PostEffectsBase : MonoBehaviour {

	// Called when start
	protected void CheckResources() {
		bool isSupported = CheckSupport();
		
		if (isSupported == false) {
			NotSupported();
		}
	}

	// Called in CheckResources to check support on this platform
	protected bool CheckSupport() {
		if (SystemInfo.supportsImageEffects == false || SystemInfo.supportsRenderTextures == false) {
			Debug.LogWarning("This platform does not support image effects or render textures.");
			return false;
		}
		
		return true;
	}

	// Called when the platform doesn't support this effect
	protected void NotSupported() {
		enabled 

你可能感兴趣的:(Unity,unity,游戏引擎)