c# - 通过脚本更改 PostProcessing 绽放效果
问题描述
我正在尝试通过脚本更改绽放颜色(后处理)。在检查器中颜色会发生变化,但在游戏视图中不会。请帮忙。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
public class PostProcceserManager : MonoBehaviour
{
PostProcessVolume volume;
Bloom bloomLayer;
public ColorParameter [] ColorArray;
private void Awake()
{
volume = gameObject.GetComponent<PostProcessVolume>();
volume.profile.TryGetSettings(out bloomLayer);
}
private void Start()
{
//change the color
volume.enabled = true;
ColorParameter x = new ColorParameter();
x.value = Color.red;
x.overrideState = true;
bloomLayer.color = x;
}
}
解决方案
推荐阅读
- google-maps - 如何在 Google Map Flutter 上显示小部件图标?
- sql - 在 T-SQL 中使用多个喜欢缩短 SQL 查询的方法
- javascript - 删除firebase实时数据库在网络中不起作用
- oracle - 我们可以将 Oracle apex 连接到 Control-M 吗?
- spring - Spring Boot 安全性中的 HTTP 403 禁止错误
- java - 即使我为所有步骤创建了步骤定义,功能文件也会显示每个步骤的警告
- amazon-dynamodb - 无法连接到本地 DynamoDB(无服务器框架)
- javascript - 查看节点请求正文
- java - 是否可以不在休眠映射中创建第三个表
- node.js - Mongoose 聚合:当我使用 replaceRoot 时,无法在我组的女巫上显示参数