1 using UnityEditor.Rendering;
3 using UnityEngine.Experimental.Rendering.HDPipeline;
4 using UnityEngine.Rendering;
6 namespace UnityEditor.Experimental.Rendering.HDPipeline
8 public class DecalMenuItems
10 [MenuItem("GameObject/Rendering/Decal Projector", priority = CoreUtils.gameObjectMenuPriority)]
11 static void CreateDecal(MenuCommand menuCommand)
13 var parent = menuCommand.context as GameObject;
14 var go = CoreEditorUtils.CreateGameObject(parent, "Decal Projector");
15 go.AddComponent<DecalProjectorComponent>();
16 // Ensure it gets re-parented if this was a context click (otherwise does nothing)
17 GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
18 // Register the creation in the undo system
19 Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
20 Selection.activeObject = go;