#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.ProjectWindowCallback;
#endif
using System;
namespace UnityEngine.Rendering.Universal
{
///
/// Class containing shader resources needed in URP for XR.
///
///
[Serializable]
public class XRSystemData : ScriptableObject
{
#if UNITY_EDITOR
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1812")]
internal class CreateXRSystemDataAsset : EndNameEditAction
{
public override void Action(int instanceId, string pathName, string resourceFile)
{
var instance = CreateInstance();
AssetDatabase.CreateAsset(instance, pathName);
ResourceReloader.ReloadAllNullIn(instance, UniversalRenderPipelineAsset.packagePath);
Selection.activeObject = instance;
}
}
[MenuItem("Assets/Create/Rendering/URP XR System Data", priority = CoreUtils.Sections.section5 + CoreUtils.Priorities.assetsCreateRenderingMenuPriority)]
static void CreateXRSystemData()
{
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, CreateInstance(), "CustomXRSystemData.asset", null, null);
}
#endif
///
/// Class containing shader resources used in URP for XR.
///
[Serializable, ReloadGroup]
public sealed class ShaderResources
{
///
/// XR Occlusion mesh shader.
///
[Reload("Shaders/XR/XROcclusionMesh.shader")]
public Shader xrOcclusionMeshPS;
///
/// XR Mirror View shader.
///
[Reload("Shaders/XR/XRMirrorView.shader")]
public Shader xrMirrorViewPS;
}
///
/// Shader resources used in URP for XR.
///
public ShaderResources shaders;
}
}