This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 82c1f210baa2e8041bb6347e6278e365
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,29 @@
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine.UIElements;
namespace UnityEditor.Rendering.Universal
{
[CustomPropertyDrawer(typeof(URPDefaultVolumeProfileSettings))]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
class URPDefaultVolumeProfileSettingsPropertyDrawer : DefaultVolumeProfileSettingsPropertyDrawer
{
protected override GUIContent defaultVolumeProfileAssetLabel => EditorGUIUtility.TrTextContent("Default Profile",
"Settings that will be applied project-wide to all Volumes by default when URP is active.");
protected override GUIContent volumeInfoBoxLabel => EditorGUIUtility.TrTextContent(
"The values in the Default Volume can be overridden by a Volume Profile assigned to URP asset and Volumes inside scenes.");
protected override VisualElement CreateAssetFieldUI()
{
return DrawDefaultVolumeObjectField<UniversalRenderPipeline, UniversalRenderPipelineAsset, URPDefaultVolumeProfileSettings>();
}
public class URPDefaultVolumeProfileSettingsContextMenu : DefaultVolumeProfileSettingsContextMenu2<
URPDefaultVolumeProfileSettings, UniversalRenderPipeline>
{
protected override string defaultVolumeProfilePath => "Assets/VolumeProfile_Default.asset";
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9c44f71308994120a70f5c6b28210698
timeCreated: 1698742927
@@ -0,0 +1,34 @@
using UnityEditor.UIElements;
using UnityEngine.Rendering.Universal;
using UnityEngine.UIElements;
namespace UnityEditor.Rendering.Universal
{
[CustomPropertyDrawer(typeof(URPTerrainShaderSetting))]
class URPRuntimeTerrainShadersPropertyDrawer : PropertyDrawer
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
var container = new VisualElement();
var relativeProperty = property.FindPropertyRelative("m_IncludeTerrainShaders");
var field = new PropertyField(relativeProperty);
#if !ENABLE_TERRAIN_MODULE
field.SetEnabled(false);
field.RegisterCallback<GeometryChangedEvent>(_ =>
{
var toggle = field.Q<Toggle>();
if (toggle != null)
{
toggle.SetValueWithoutNotify(false);
toggle.tooltip = "The Terrain module is disabled in Package Manager. Terrain shaders will be automatically stripped from the build.";
}
});
#endif
container.Add(field);
return container;
}
}
}
@@ -0,0 +1,13 @@
using UnityEngine.Rendering.Universal;
namespace UnityEditor.Rendering.Universal
{
[CustomPropertyDrawer(typeof(URPShaderStrippingSetting))]
class ShaderStrippingSettingPropertyDrawer : RelativePropertiesDrawer
{
protected override string[] relativePropertiesNames => new[]
{
"m_StripUnusedPostProcessingVariantsAndResources", "m_StripUnusedVariants", "m_Strip2DUnusedVariants", "m_StripScreenCoordOverrideVariants"
};
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 96356c82da2c2c54c8829d0ed7497562
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,79 @@
using System.Collections.Generic;
using System.Reflection;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEditor.Rendering.Universal;
using UnityEngine;
using UnityEngine.Rendering;
namespace UnityEditor.Rendering.Universal
{
static class PackageManagerHelper
{
public static void OpenPackageManagerToPackage(string packageName)
{
var packageManagerUI = typeof(Editor).Assembly
.GetType("UnityEditor.PackageManager.UI.Window");
if (packageManagerUI != null)
{
var openMethod = packageManagerUI.GetMethod("Open", BindingFlags.Public | BindingFlags.Static);
openMethod?.Invoke(null, new object[] { packageName });
}
else
{
Debug.LogWarning("Could not find PackageManager UI type. Package Manager may have changed.");
}
}
}
/// <summary>
/// Editor Preferences for URP
/// </summary>
[DisplayInfo(name = "Universal Render Pipeline", order = 300)]
public class UniversalRenderPipelinePreferencesProvider : ICoreRenderPipelinePreferencesProvider
{
class Styles
{
public static readonly GUIContent configPackageLabel = new("Config Package", "Choose whether to embed or sync with registry version.");
public static readonly GUIContent viewInPackageManagerLabel = new("View in Package Manager", "");
public static readonly GUIContent urpProjectSettingsPathLabel = EditorGUIUtility.TrTextContent("Resources Folder Name", "Resources Folder will be the one where to get project elements related to URP as default scene and default settings.");
}
static List<string> s_SearchKeywords = new() {
"Default Resources Folder",
"Config Package"
};
/// <summary>
/// Keywords for the preferences
/// </summary>
public List<string> keywords => s_SearchKeywords;
/// <summary>
/// UI for the preferences.
/// </summary>
public void PreferenceGUI()
{
EditorGUI.indentLevel++;
UniversalProjectSettings.projectSettingsFolderPath = EditorGUILayout.TextField(Styles.urpProjectSettingsPathLabel, UniversalProjectSettings.projectSettingsFolderPath);
DrawConfigPackageDropdown();
EditorGUI.indentLevel--;
}
private const string k_PackageName = "com.unity.render-pipelines.universal-config";
void DrawConfigPackageDropdown()
{
GUILayout.BeginHorizontal();
EditorGUILayout.LabelField(Styles.configPackageLabel, GUILayout.Width(EditorGUIUtility.labelWidth));
if (GUILayout.Button(Styles.viewInPackageManagerLabel, GUILayout.Width(200)))
{
PackageManagerHelper.OpenPackageManagerToPackage(k_PackageName);
}
GUILayout.EndHorizontal();
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: dfe4e1c6ce66d514bafdec16128f59ed