Adaug proiectul Unity

This commit is contained in:
2026-11-01 23:39:55 +02:00
parent cb14d9d37d
commit 863eac8f2c
23463 changed files with 5412601 additions and 0 deletions
@@ -0,0 +1,8 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // permit using internal interfaces with Moq
[assembly: InternalsVisibleTo("UniversalGraphicsTests")]
[assembly: InternalsVisibleTo("Unity.RenderPipelines.Universal.Editor.Tests")]
[assembly: InternalsVisibleTo("Unity.Testing.SRP.Universal-Upgrade.Editor")]
[assembly: InternalsVisibleTo("Unity.GraphicTests.Performance.Universal.Editor")]
[assembly: InternalsVisibleTo("Unity.VisualEffectGraph.EditorTests")]
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bcdc8c86abfb40a45aa7ea6f4d34cb13
@@ -0,0 +1,48 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace UnityEditor.Rendering.Universal
{
[CustomEditor(typeof(MeshRenderer))]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
[CanEditMultipleObjects]
internal class Renderer2DMeshEditor : MeshRendererEditor
{
SerializedProperty m_MaskInteraction;
SavedBool m_2DFoldout;
class Styles
{
public static readonly GUIContent maskInteractionLabel = EditorGUIUtility.TrTextContent("Mask Interaction", "Renderer's interaction with a Sprite Mask");
}
public override void OnEnable()
{
base.OnEnable();
m_MaskInteraction = serializedObject.FindProperty("m_MaskInteraction");
m_2DFoldout = new SavedBool($"{target.GetType()}.MeshEditor2DFoldout", true);
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
serializedObject.Update();
var rpAsset = UniversalRenderPipeline.asset;
if (rpAsset != null && (rpAsset.scriptableRenderer is Renderer2D))
{
m_2DFoldout.value = EditorGUILayout.Foldout(m_2DFoldout.value, "2D");
if (m_2DFoldout)
{
EditorGUI.indentLevel++;
m_MaskInteraction.intValue = Convert.ToInt32(EditorGUILayout.EnumPopup(Styles.maskInteractionLabel, (SpriteMaskInteraction)m_MaskInteraction.intValue));
EditorGUI.indentLevel--;
}
}
serializedObject.ApplyModifiedProperties();
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bce6289b8f1e3bf4a82078371dffaebd
@@ -0,0 +1,36 @@
using UnityEngine;
using UnityEngine.Rendering.Universal;
namespace UnityEditor.Rendering.Universal
{
/// <summary>
/// Custom editor for the ScriptableRendererFeature2D class, allowing for the configuration of renderer features in the Unity Editor.
/// </summary>
[CustomEditor(typeof(ScriptableRendererFeature2D), true)]
public class ScriptableRendererFeature2DEditor : Editor
{
private SerializedProperty m_InjectionPointProperty;
private SerializedProperty m_SortingLayerProperty;
private static readonly GUIContent k_InjectionPointGuiContent = new GUIContent("Injection Point", "Specifies where in the frame this pass will be injected.");
private void OnEnable()
{
m_InjectionPointProperty = serializedObject.FindProperty("injectionPoint2D");
m_SortingLayerProperty = serializedObject.FindProperty("sortingLayerID");
}
/// <summary>
/// Implementation for a ScriptableRendererFeature2D inspector.
/// </summary>
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
EditorGUILayout.PropertyField(m_InjectionPointProperty, k_InjectionPointGuiContent);
if (ScriptableRenderPass2D.IsSortingLayerEvent((RenderPassEvent2D)m_InjectionPointProperty.intValue))
SortingLayerEditorUtility.RenderSortingLayerFields(m_SortingLayerProperty);
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0f8c4e2f372f94e4dbbdc7ce528a8ba4
@@ -0,0 +1,48 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace UnityEditor.Rendering.Universal
{
[CustomEditor(typeof(SkinnedMeshRenderer))]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
[CanEditMultipleObjects]
internal class SkinnedMeshEditor2DURP : SkinnedMeshRendererEditor
{
SerializedProperty m_MaskInteraction;
SavedBool m_2DFoldout;
new class Styles
{
public static readonly GUIContent maskInteractionLabel = EditorGUIUtility.TrTextContent("Mask Interaction", "Renderer's interaction with a Sprite Mask");
}
public override void OnEnable()
{
base.OnEnable();
m_MaskInteraction = serializedObject.FindProperty("m_MaskInteraction");
m_2DFoldout = new SavedBool($"{target.GetType()}.SkinnedMeshEditor2DFoldout", true);
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
serializedObject.Update();
var rpAsset = UniversalRenderPipeline.asset;
if (rpAsset != null && (rpAsset.scriptableRenderer is Renderer2D))
{
m_2DFoldout.value = EditorGUILayout.Foldout(m_2DFoldout.value, "2D");
if (m_2DFoldout)
{
EditorGUI.indentLevel++;
m_MaskInteraction.intValue = Convert.ToInt32(EditorGUILayout.EnumPopup(Styles.maskInteractionLabel, (SpriteMaskInteraction)m_MaskInteraction.intValue));
EditorGUI.indentLevel--;
}
}
serializedObject.ApplyModifiedProperties();
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d1e4d2637b6c6824e82557977a6727d4
@@ -0,0 +1,120 @@
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace UnityEditor
{
[CustomEditor(typeof(SortingGroup))]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
[CanEditMultipleObjects]
internal class SortingGroupEditor2DURP : SortingGroupEditor
{
private enum SortType
{
Default,
SortAtRoot,
Sort3DAs2D
}
private static class GUIStyles
{
public static GUIContent Default = EditorGUIUtility.TrTextContent("Sorting Type",
"Default sorting based on sorting layer and sorting order.");
public static GUIContent sortAtRootStyle = EditorGUIUtility.TrTextContent("Sorting Type",
"Ignores all parent Sorting Groups and sorts at the root level against other Sorting Groups and Renderers");
public static GUIContent sort3DAs2D = EditorGUIUtility.TrTextContent("Sorting Type",
"Clears z values on 3D meshes affected by a Sorting Group allowing them to sort with other 2D objects and Sort 3D as 2D sorting groups. This option also enables Sort At Root");
}
private SerializedProperty m_Sort3DAs2D;
private SortType m_SortType;
public override void OnEnable()
{
base.OnEnable();
m_Sort3DAs2D = serializedObject.FindProperty("m_Sort3DAs2D");
// Initialize m_SortType
m_SortType = m_Sort3DAs2D.boolValue ? SortType.Sort3DAs2D : m_SortAtRoot.boolValue ? SortType.SortAtRoot : SortType.Default;
}
void OnInspectorGUIFor2D()
{
serializedObject.Update();
SortingLayerEditorUtility.RenderSortingLayerFields(m_SortingOrder, m_SortingLayerID);
var prevSortType = m_SortType;
var label = m_Sort3DAs2D.boolValue ? GUIStyles.sort3DAs2D : m_SortAtRoot.boolValue ? GUIStyles.sortAtRootStyle : GUIStyles.Default;
m_SortType = (SortType)EditorGUILayout.EnumPopup(label, m_SortType);
if (prevSortType != m_SortType)
{
switch (m_SortType)
{
case SortType.SortAtRoot:
m_SortAtRoot.boolValue = true;
m_Sort3DAs2D.boolValue = false;
break;
case SortType.Sort3DAs2D:
m_SortAtRoot.boolValue = true;
m_Sort3DAs2D.boolValue = true;
break;
default:
m_SortAtRoot.boolValue = false;
m_Sort3DAs2D.boolValue = false;
break;
}
}
foreach (var target in targets)
{
SortingGroup sortingGroup = (SortingGroup)target;
GameObject go = sortingGroup.gameObject;
go.TryGetComponent(out RenderAs2D renderAs2D);
if (sortingGroup.sort3DAs2D)
{
if (renderAs2D != null && !renderAs2D.IsOwner(sortingGroup))
{
DestroyImmediate(renderAs2D, true);
renderAs2D = null;
}
if (renderAs2D == null)
{
Material mat = AssetDatabase.LoadAssetAtPath<Material>("Packages/com.unity.render-pipelines.universal/Runtime/Materials/RenderAs2D-Flattening.mat");
renderAs2D = go.AddComponent<RenderAs2D>();
renderAs2D.Init(sortingGroup);
renderAs2D.material = mat;
EditorUtility.SetDirty(go);
}
}
else
{
if (renderAs2D != null)
{
DestroyImmediate(renderAs2D, true);
renderAs2D = null;
}
}
}
serializedObject.ApplyModifiedProperties();
}
public override void OnInspectorGUI()
{
var rpAsset = UniversalRenderPipeline.asset;
if (rpAsset != null && (rpAsset.scriptableRenderer is Renderer2D))
OnInspectorGUIFor2D();
else
base.OnInspectorGUI();
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7dac6048e6e7a4747ad93c64661d3faf
@@ -0,0 +1,60 @@
{
"name": "Unity.RenderPipelines.Universal.2D.Editor.Overrides",
"rootNamespace": "",
"references": [
"GUID:15fc0a57446b3144c949da3e2b9737a9",
"GUID:d60799ab2a985554ea1a39cd38695018",
"GUID:a35efad8797223d499f8c68b1f545dbc",
"GUID:df380645f10b7bc4b97d4f5eb6303d95",
"GUID:69257879134bba646869b21467b3338d",
"GUID:3eae0364be2026648bf74846acb8a731",
"GUID:2a69708d171a17043a9d0ad45f205cfe",
"GUID:be0903cd8e1546f498710afdc59db5eb",
"GUID:b75d3cd3037d383a8d1e2f9a26d73d8a",
"GUID:329b4ccd385744985bf3f83cfd77dfe7",
"GUID:9604b18aafdbc9346bceb5e19ac9c746",
"GUID:f9fe0089ec81f4079af78eb2287a6163",
"GUID:116a4d4dbf5c04973bbf517077a062a1",
"GUID:e40ba710768534012815d3193fa296cb",
"GUID:516a5277b8c3b4f4c8cc86b77b1591ff",
"GUID:4fd6538c1c56b409fb53fdf0183170ec",
"GUID:41524c21c95e5fe4dbc5b48bd21995a4"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": true,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.adaptiveperformance",
"expression": "2.0.0-preview.7",
"define": "ADAPTIVE_PERFORMANCE_2_0_0_OR_NEWER"
},
{
"name": "com.unity.modules.xr",
"expression": "1.0.0",
"define": "ENABLE_XR_MODULE"
},
{
"name": "com.unity.xr.management",
"expression": "4.0.1",
"define": "XR_MANAGEMENT_4_0_1_OR_NEWER"
},
{
"name": "com.unity.visualeffectgraph",
"expression": "1.0.0",
"define": "HAS_VFX_GRAPH"
},
{
"name": "com.unity.2d.animation",
"expression": "10.0.0-pre.1",
"define": "USING_2DANIMATION"
}
],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 71872915d7faaaf47a5587bce19d5214
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: