OSDN Git Service

Added Assets for main menu
[mindgames/Mindgames_main.git] / Mindgames / Library / PackageCache / com.unity.render-pipelines.high-definition@6.9.0-preview / Editor / Material / Decal / DecalMenuItems.cs
1 using UnityEditor.Rendering;
2 using UnityEngine;
3 using UnityEngine.Experimental.Rendering.HDPipeline;
4 using UnityEngine.Rendering;
5
6 namespace UnityEditor.Experimental.Rendering.HDPipeline
7 {
8     public class DecalMenuItems
9     {
10         [MenuItem("GameObject/Rendering/Decal Projector", priority = CoreUtils.gameObjectMenuPriority)]
11         static void CreateDecal(MenuCommand menuCommand)
12         {
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;
21         }
22     }
23 }