using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
namespace UnityTcp.Editor.Helpers
{
///
/// Compatibility surface for UnityEngine.Rendering.PassType and
/// construction.
///
/// Tuanjie / Unity editors disagree on which assembly hosts PassType and
/// which enum members exist (e.g. ScriptableRenderPipeline*). Referencing
/// the type at compile time produces CS0246 on some editors, so every
/// lookup and constructor call goes through reflection. Callers speak
/// string pass names; missing types or members are skipped, not compiled
/// against.
///
public static class ShaderVariantApi
{
static readonly Type PassTypeType = ResolvePassTypeType();
static readonly ConstructorInfo VariantCtor = ResolveVariantCtor();
static readonly Dictionary Aliases =
new Dictionary(StringComparer.OrdinalIgnoreCase)
{
["forward"] = "ForwardBase",
["forwardlit"] = "ForwardBase",
["forwardbase"] = "ForwardBase",
["forwardadd"] = "ForwardAdd",
["shadowcaster"] = "ShadowCaster",
["deferred"] = "Deferred",
["srp"] = "ScriptableRenderPipeline",
["scriptablerp"] = "ScriptableRenderPipeline",
["defaultunlit"] = "ScriptableRenderPipelineDefaultUnlit",
};
static readonly string[] DefaultPassNames =
{
"Normal",
"ShadowCaster",
"ScriptableRenderPipeline",
};
/// True when this editor exposes a PassType enum we can resolve.
public static bool IsAvailable => PassTypeType != null && PassTypeType.IsEnum;
public static IReadOnlyList