Unity/C#
유니티 라이트 레졸루션 개별설정
모카쨩
2024. 5. 12. 12:01
유니티 2022.3.22.f1 이후의 경우
유니티 2022.3.22.f1 이전의 경우는 아래 스크립트 적용
SettingLightResolution.unitypackage
0.00MB
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteAlways]
public class SettingLightResolution : MonoBehaviour
{
public Light light;
public int resolution = 256;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (light==null)
{
return;
}
light.shadowCustomResolution = resolution;
#if UNITY_EDITOR
UnityEditor.EditorUtility.SetDirty(light);
#endif
}
}
어쩌다보니 만들게 됨