Files
cloud-mainworld/ufm cloud/Assets/#User/TheCloud/Scripts/General Plugin/UnitySettings.cs
T
2026-10-22 12:50:44 +01:00

35 lines
984 B
C#

using UnityEngine;
using UnityEngine.Rendering.Universal;
namespace SomniumSpace.Worlds.TheCloud
{
/// <summary>
/// Use this component to set some unity settings for your world
/// </summary>
public class UnitySettings : MonoBehaviour
{
[Range(1,8)]
[SerializeField] int _maxLightCount = 3;
private int _lightCountBefore = 1;
private void Awake()
{
UniversalRenderPipelineAsset urpAsset = UniversalRenderPipeline.asset;
if (urpAsset != null)
{
_lightCountBefore = urpAsset.maxAdditionalLightsCount;
urpAsset.maxAdditionalLightsCount = _maxLightCount;
}
}
private void OnDestroy()
{
UniversalRenderPipelineAsset urpAsset = UniversalRenderPipeline.asset;
if (urpAsset != null)
{
urpAsset.maxAdditionalLightsCount = _lightCountBefore;
}
}
}
}