rj-action-library/Runtime/Rendering/RenderingManager.cs

37 lines
712 B
C#
Raw Normal View History

2025-08-31 06:05:39 +00:00
using System.Diagnostics;
2024-12-01 17:07:41 +00:00
using System.Collections;
using System.Collections.Generic;
2025-08-31 06:05:39 +00:00
using System;
using Godot;
2024-12-01 17:07:41 +00:00
namespace Rokojori
{
[Tool]
[GlobalClass]
2025-08-31 06:05:39 +00:00
public partial class RenderingManager:Node
{
2024-12-01 17:07:41 +00:00
[Export]
2025-08-31 06:05:39 +00:00
public RenderingManagerData data;
2025-09-17 08:25:03 +00:00
public static int GetStencilReferenceIndex( StencilLayer stencilLayer )
{
if ( stencilLayer == null )
{
return -1;
}
var rm = Unique<RenderingManager>.Get();
if ( rm == null )
{
return stencilLayer.fallBackIndex;
}
var rmIndex = rm.data.stencilLayers.IndexOf( stencilLayer );
return rmIndex == -1 ? stencilLayer.fallBackIndex : ( rmIndex + 1 );
}
2024-12-01 17:07:41 +00:00
}
}