您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
23 行
926 B
23 行
926 B
using System.IO;
|
|
using UnityEngine;
|
|
using UnityEngine.Experimental.Rendering;
|
|
using UnityEngine.Experimental.Rendering.HDPipeline;
|
|
|
|
namespace UnityEditor.Experimental.Rendering.HDPipeline
|
|
{
|
|
public class DecalMenuItems
|
|
{
|
|
[MenuItem("GameObject/Rendering/DecalProjector", priority = CoreUtils.gameObjectMenuPriority)]
|
|
static void CreateDecal(MenuCommand menuCommand)
|
|
{
|
|
// Create a custom game object
|
|
GameObject go = new GameObject("DecalProjector");
|
|
go.AddComponent<DecalProjectorComponent>();
|
|
// Ensure it gets re-parented if this was a context click (otherwise does nothing)
|
|
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
|
|
// Register the creation in the undo system
|
|
Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
|
|
Selection.activeObject = go;
|
|
}
|
|
}
|
|
}
|