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,72 @@
#if !UNITY_WEBGL_RENDERER_ONLY
using System;
using UnityEngine.Serialization;
namespace UnityEngine.Rendering
{
[ExecuteInEditMode]
internal class DisallowGPUDrivenRendering : MonoBehaviour
{
private bool m_AppliedRecursively;
[FormerlySerializedAs("applyToChildrenRecursively")]
public bool m_applyToChildrenRecursively;
public bool applyToChildrenRecursively
{
get => m_applyToChildrenRecursively;
set
{
m_applyToChildrenRecursively = value;
OnDisable();
OnEnable();
}
}
private void OnEnable()
{
m_AppliedRecursively = applyToChildrenRecursively;
if (applyToChildrenRecursively)
AllowGPUDrivenRenderingRecursively(transform, false);
else
AllowGPUDrivenRendering(transform, false);
}
private void OnDisable()
{
if (m_AppliedRecursively)
AllowGPUDrivenRenderingRecursively(transform, true);
else
AllowGPUDrivenRendering(transform, true);
}
private static void AllowGPUDrivenRendering(Transform transform, bool allow)
{
var renderer = transform.GetComponent<MeshRenderer>();
if (renderer)
renderer.allowGPUDrivenRendering = allow;
}
private static void AllowGPUDrivenRenderingRecursively(Transform transform, bool allow)
{
AllowGPUDrivenRendering(transform, allow);
foreach (Transform child in transform)
{
if (!child.GetComponent<DisallowGPUDrivenRendering>())
AllowGPUDrivenRenderingRecursively(child, allow);
}
}
private void OnValidate()
{
OnDisable();
if (enabled)
OnEnable();
}
}
}
#endif // !UNITY_WEBGL_RENDERER_ONLY
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 644debc0b7d33d043af3caab53baa000
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,68 @@
#if !UNITY_WEBGL_RENDERER_ONLY
using System;
namespace UnityEngine.Rendering
{
[ExecuteInEditMode]
internal class DisallowSmallMeshCulling : MonoBehaviour
{
private bool m_AppliedRecursively;
public bool m_applyToChildrenRecursively;
public bool applyToChildrenRecursively
{
get => m_applyToChildrenRecursively;
set
{
m_applyToChildrenRecursively = value;
OnDisable();
OnEnable();
}
}
private void OnEnable()
{
m_AppliedRecursively = applyToChildrenRecursively;
if (applyToChildrenRecursively)
AllowSmallMeshCullingRecursively(transform, false);
else
AllowSmallMeshCulling(transform, false);
}
private void OnDisable()
{
if (m_AppliedRecursively)
AllowSmallMeshCullingRecursively(transform, true);
else
AllowSmallMeshCulling(transform, true);
}
private static void AllowSmallMeshCulling(Transform transform, bool allow)
{
var renderer = transform.GetComponent<MeshRenderer>();
if (renderer)
renderer.smallMeshCulling = allow;
}
private static void AllowSmallMeshCullingRecursively(Transform transform, bool allow)
{
AllowSmallMeshCulling(transform, allow);
foreach (Transform child in transform)
{
if (!child.GetComponent<DisallowGPUDrivenRendering>())
AllowSmallMeshCullingRecursively(child, allow);
}
}
private void OnValidate()
{
OnDisable();
OnEnable();
}
}
}
#endif // !UNITY_WEBGL_RENDERER_ONLY
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a55bb9f7efce64f3ab3a138447cb46c0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: