Skip to content

Commit

Permalink
新しいバージョンのUnityで削除されたプロパティを参照していたバグの対応
Browse files Browse the repository at this point in the history
  • Loading branch information
AraiYuhki authored and durswd committed May 13, 2024
1 parent 4e4a50f commit 36cf4a1
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,25 @@ public override void Execute(ScriptableRenderContext context, ref UnityEngine.Re
if (Effekseer.EffekseerSystem.Instance == null) return;
#if EFFEKSEER_URP_DEPTHTARGET_FIX
var renderer = renderingData.cameraData.renderer;
#if UNITY_2022_3_OR_NEWER
prop.colorTargetIdentifier = renderer.cameraColorTargetHandle;
#else
prop.colorTargetIdentifier = renderer.cameraColorTarget;
#endif

// NOTE: We need to know whether the depth in cameraDepthTarget is valid or not since if it is valid,
// we need to pass cameraDepthTarget to SetRenderTarget() later on. If it isn't valid, the depth in
// cameraColorTarget is used instead.
var isValidDepth = IsValidCameraDepthTarget(renderer.cameraDepthTarget);
#if UNITY_2022_3_OR_NEWER
var cameraDepthTarget = renderer.cameraDepthTargetHandle;
#else
var cameraDepthTarget = renderer.cameraDepthTarget;
#endif
var isValidDepth = IsValidCameraDepthTarget(cameraDepthTarget);

if (isValidDepth)
{
prop.depthTargetIdentifier = renderer.cameraDepthTarget;
prop.depthTargetIdentifier = cameraDepthTarget;
}
else
{
Expand Down

0 comments on commit 36cf4a1

Please sign in to comment.