You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
45 lines
1.5 KiB
#if UNITY_EDITOR |
|
using UnityEditor; |
|
using UnityEditor.ProjectWindowCallback; |
|
#endif |
|
using System; |
|
|
|
namespace UnityEngine.Rendering.Universal |
|
{ |
|
[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<XRSystemData>(); |
|
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<CreateXRSystemDataAsset>(), "CustomXRSystemData.asset", null, null); |
|
} |
|
|
|
#endif |
|
|
|
[Serializable, ReloadGroup] |
|
public sealed class ShaderResources |
|
{ |
|
[Reload("Shaders/XR/XROcclusionMesh.shader")] |
|
public Shader xrOcclusionMeshPS; |
|
|
|
[Reload("Shaders/XR/XRMirrorView.shader")] |
|
public Shader xrMirrorViewPS; |
|
} |
|
|
|
public ShaderResources shaders; |
|
} |
|
}
|
|
|