| 123456789101112131415161718192021 |
- using UnityEngine;
- using UnityEngine.Rendering.PostProcessing;
- namespace UnityEditor.Rendering.PostProcessing
- {
- internal static class VolumeFactory
- {
- [MenuItem("GameObject/3D Object/Post-process Volume")]
- static void CreateVolume()
- {
- var gameObject = new GameObject("Post-process Volume");
- var collider = gameObject.AddComponent<BoxCollider>();
- collider.size = Vector3.one;
- collider.isTrigger = true;
- gameObject.AddComponent<PostProcessVolume>();
- Selection.objects = new [] { gameObject };
- EditorApplication.ExecuteMenuItem("GameObject/Move To View");
- }
- }
- }
|