37 lines
712 B
C#
37 lines
712 B
C#
|
|
using System.Diagnostics;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
using Godot;
|
|
|
|
|
|
namespace Rokojori
|
|
{
|
|
[Tool]
|
|
[GlobalClass]
|
|
public partial class RenderingManager:Node
|
|
{
|
|
[Export]
|
|
public RenderingManagerData data;
|
|
|
|
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 );
|
|
}
|
|
}
|
|
} |