您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
22 行
891 B
22 行
891 B
using System.IO;
|
|
using UnityEngine;
|
|
using UnityEngine.Experimental.Rendering;
|
|
using UnityEngine.Experimental.Rendering.HDPipeline;
|
|
|
|
namespace UnityEditor.Experimental.Rendering.HDPipeline
|
|
{
|
|
public class VolumetricMenuItems
|
|
{
|
|
[MenuItem("GameObject/Rendering/Density Volume", priority = CoreUtils.gameObjectMenuPriority)]
|
|
static void CreateDensityVolumeGameObject(MenuCommand menuCommand)
|
|
{
|
|
var parent = menuCommand.context as GameObject;
|
|
var densityVolume = CoreEditorUtils.CreateGameObject(parent, "Density Volume");
|
|
GameObjectUtility.SetParentAndAlign(densityVolume, menuCommand.context as GameObject);
|
|
Undo.RegisterCreatedObjectUndo(densityVolume, "Create " + densityVolume.name);
|
|
Selection.activeObject = densityVolume;
|
|
|
|
densityVolume.AddComponent<DensityVolume>();
|
|
}
|
|
}
|
|
}
|