-
Notifications
You must be signed in to change notification settings - Fork 878
Expand file tree
/
Copy pathPostProcessAttribute.cs
More file actions
60 lines (53 loc) · 2.29 KB
/
Copy pathPostProcessAttribute.cs
File metadata and controls
60 lines (53 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
namespace UnityEngine.Rendering.PostProcessing
{
/// <summary>
/// Use this attribute to associate a <see cref="PostProcessEffectSettings"/> to a
/// <see cref="PostProcessEffectRenderer{T}"/> type.
/// </summary>
/// <seealso cref="PostProcessEffectSettings"/>
/// <seealso cref="PostProcessEffectRenderer{T}"/>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class PostProcessAttribute : Attribute
{
/// <summary>
/// The renderer type to associate with a <see cref="PostProcessEffectSettings"/>.
/// </summary>
public readonly Type renderer;
/// <summary>
/// The injection point for the effect.
/// </summary>
public readonly PostProcessEvent eventType;
/// <summary>
/// The menu item name to set for the effect. You can use a `/` character to add sub-menus.
/// </summary>
public readonly string menuItem;
/// <summary>
/// Should this effect be allowed in the Scene View?
/// </summary>
public readonly bool allowInSceneView;
internal readonly bool builtinEffect;
/// <summary>
/// Creates a new attribute.
/// </summary>
/// <param name="renderer">The renderer type to associate with a <see cref="PostProcessEffectSettings"/></param>
/// <param name="eventType">The injection point for the effect</param>
/// <param name="menuItem">The menu item name to set for the effect. You can use a `/` character to add sub-menus.</param>
/// <param name="allowInSceneView">Should this effect be allowed in the Scene View?</param>
public PostProcessAttribute(Type renderer, PostProcessEvent eventType, string menuItem, bool allowInSceneView = true)
{
this.renderer = renderer;
this.eventType = eventType;
this.menuItem = menuItem;
this.allowInSceneView = allowInSceneView;
builtinEffect = false;
}
internal PostProcessAttribute(Type renderer, string menuItem, bool allowInSceneView = true)
{
this.renderer = renderer;
this.menuItem = menuItem;
this.allowInSceneView = allowInSceneView;
builtinEffect = true;
}
}
}