Decompiled source of CullFactory Beta v2.0.2
CullFactory.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using CullFactory.Behaviours.API; using CullFactory.Behaviours.CullingMethods; using CullFactory.Behaviours.Visualization; using CullFactory.Data; using CullFactory.Extenders; using CullFactory.Services; using CullFactoryBurst; using DunGen; using DunGen.Graph; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Burst; using Unity.Burst.LowLevel; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using Unity.Netcode; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: AssemblyCompany("CullFactory")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+91233b0fc2028557c119488ec1536f2fc844b62c")] [assembly: AssemblyProduct("CullFactory")] [assembly: AssemblyTitle("CullFactory")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class IsUnmanagedAttribute : Attribute { } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CullFactory { public static class Config { private const string DungeonFlowListDescription = "\n\nValue:\nA list of dungeon generators, separated by commas \",\"."; private static readonly Version DefaultVersion = new Version(0, 0, 0); private static readonly string VersionFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, "version"); private static readonly string[] DefaultMoonScenesToBlockCulling = new string[3] { "LevelZeranos", "ProminenceScene", "NotezLevel3Outfall" }; private static readonly string[] DefaultFlowsToBlockCulling = new string[1] { "HadalFlow" }; private static readonly string[] BaseSetOfInteriorsToUseFallbackPortals = new string[3] { "BunkerFlow", "School", "CIDOMFlow" }; private static ConfigEntry<CullingType> Culler; private static ConfigEntry<string> MoonScenesToBlockCulling; private static ConfigEntry<string> MoonScenesToForceCulling; private static ConfigEntry<string> InteriorsToBlockCulling; private static ConfigEntry<string> InteriorsToForceCulling; public static string[] MoonScenesWithDisabledCulling = Array.Empty<string>(); public static string[] InteriorsWithDisabledCulling = Array.Empty<string>(); public static ConfigEntry<bool> Logging { get; private set; } public static ConfigEntry<float> UpdateFrequency { get; private set; } public static ConfigEntry<bool> DisableShadowDistanceFading { get; private set; } public static ConfigEntry<bool> DisableLODCulling { get; private set; } public static ConfigEntry<string> InteriorsToUseFallbackPortals { get; private set; } public static ConfigEntry<string> InteriorsToSkipFallbackPortals { get; private set; } public static ConfigEntry<int> MaxBranchingDepth { get; private set; } public static ConfigEntry<bool> CullDistanceEnabled { get; private set; } public static ConfigEntry<float> CullDistance { get; private set; } public static ConfigEntry<float> SurfaceCullDistance { get; private set; } public static ConfigEntry<string> OverrideMapSeed { get; private set; } public static ConfigEntry<bool> VisualizePortals { get; private set; } public static ConfigEntry<float> VisualizedPortalOutsetDistance { get; private set; } public static ConfigEntry<bool> VisualizeTileBounds { get; private set; } public static string[] InteriorsWithFallbackPortals { get; private set; } public static void Initialize(ConfigFile configFile) { Culler = configFile.Bind<CullingType>("General", "Culling type", CullingType.PortalOcclusionCulling, "The culling type to use.\n\nOptions:\n\"PortalOcclusionCulling\": Hides all the rooms that aren't visible to the camera (Recommended)\n\"DepthCulling\": Hides rooms that aren't adjacent to the player's current room"); MoonScenesToBlockCulling = configFile.Bind<string>("General", "Disable culling for moons", "", "A list of moon scenes to disable culling on, separated by commas, i.e.\n\"Level2Assurance, Level8Titan\"\n\nValue:\nA list of dungeon generators, separated by commas \",\"."); MoonScenesToForceCulling = configFile.Bind<string>("General", "Force enable culling for moons", "", "A list of moon scenes to have culling force-enabled if not blocked based on other criteria. " + GetBuiltinBlacklistText(DefaultMoonScenesToBlockCulling) + "\n\nValue:\nA list of dungeon generators, separated by commas \",\"."); InteriorsToBlockCulling = configFile.Bind<string>("General", "Disable culling for interiors", "", "A list of dungeon flows to disable culling on, separated by commas, i.e.\n\"Level1Flow, Level2Flow\"\n\nValue:\nA list of dungeon generators, separated by commas \",\"."); InteriorsToForceCulling = configFile.Bind<string>("General", "Force enable culling for interiors", "", "A list of dungeon flows to have culling force-enabled if not blocked based on other criteria. " + GetBuiltinBlacklistText(DefaultFlowsToBlockCulling) + "\n\nValue:\nA list of dungeon generators, separated by commas \",\"."); UpdateFrequency = configFile.Bind<float>("General", "Update frequency", 0f, "Higher values make culling more responsive at the cost of performance.\nCurrently this has no effect when portal occlusion culling is used.\nUpdate interval: 1 / value (seconds)"); DisableShadowDistanceFading = configFile.Bind<bool>("General", "Disable shadow distance fading", true, "Prevents lights' shadows from being hidden before the light itself becomes invisible.\nFixes issues that are common in Mansion where some lights will be visible through walls, and allows more lights/tiles to be culled within the interior.\nDisabling may have a negative impact on performance."); DisableLODCulling = configFile.Bind<bool>("General", "Disable LOD culling", true, "Forces the last LOD to stay visible for all static objects in the interior. This will prevent the stairs on the factory interior from disappearing at a distance, and should also prevent any other similar disappearing objects.\nObjects that have LOD groups will instead be culled based on visibility, so this has a minimal effect on performance."); InteriorsToUseFallbackPortals = configFile.Bind<string>("Portal occlusion culling", "Use fallback portals for interiors", "", "Uses the maximum possible doorway sizes in each tile for visibility testing in the specified interiors.\nThis is recommended for interiors with incorrect doorway sizes.\n\nValue:\nA list of dungeon generators, separated by commas \",\"."); InteriorsToSkipFallbackPortals = configFile.Bind<string>("Portal occlusion culling", "Skip fallback portals for interiors", "", "Skip using fallback portals on previously problematic interiors:\n" + BaseSetOfInteriorsToUseFallbackPortals.JoinByComma() + "\n\nValue:\nA list of dungeon generators, separated by commas \",\"."); MaxBranchingDepth = configFile.Bind<int>("Depth culling", "Max branching depth", 4, "How many doors can be traversed before a room is culled."); CullDistanceEnabled = configFile.Bind<bool>("Distance culling", "Enabled", false, "Whether to override the camera's far plane distance. When this is false, the 'Cull distance' and 'Surface cull distance' options will have no effect.\nIf performance with portal occlusion culling enabled is insufficient this may provide a small boost in performance."); CullDistance = configFile.Bind<float>("Distance culling", "Cull distance", 40f, "The camera's far plane distance.\nObjects that are this far from the player will be culled.\nVanilla value: 400"); SurfaceCullDistance = configFile.Bind<float>("Distance culling", "Surface cull distance", 200f, "The camera's far plane distance when **on the surface**.\nObjects that are this far from the player will be culled.\nVanilla value: 400"); VisualizePortals = configFile.Bind<bool>("Debug", "Visualize portals", false, "Shows a rectangle representing the bounds of all portals that are used to determine visibility when portal occlusion culling is enabled. If the portal doesn't block the entirety of the visible portion of the next tile, then culling will not be correct."); VisualizedPortalOutsetDistance = configFile.Bind<float>("Debug", "Visualized portal outset distance", 0.2f, "The distance to offset each side of a portal visualizer out from the actual position of the portal. For doors that don't cover an entire tile wall, this allows seeing the exact bounds it covers."); VisualizeTileBounds = configFile.Bind<bool>("Debug", "Visualize tile bounds", false, "Shows a rectangular prism to represent the bounds all tiles. These bounds are used to determine which tile a camera resides in."); OverrideMapSeed = configFile.Bind<string>("Debug", "Override map seed", "", "INTENDED FOR BENCHMARKING ONLY. Leave this empty if you are playing normally.\nThis forces the map seed to be whatever is entered here, so that benchmarking numbers can remain as consistent as possible between runs."); Logging = configFile.Bind<bool>("Debug", "Show culling logs", false, "View culling activity in the console."); MigrateSettings(); Culler.SettingChanged += delegate { CullingMethod.Initialize(); }; MoonScenesToBlockCulling.SettingChanged += delegate { UpdateMoonScenesWithDisabledCulling(); }; MoonScenesToForceCulling.SettingChanged += delegate { UpdateMoonScenesWithDisabledCulling(); }; InteriorsToBlockCulling.SettingChanged += delegate { UpdateInteriorsWithDisabledCulling(); }; InteriorsToForceCulling.SettingChanged += delegate { UpdateInteriorsWithDisabledCulling(); }; UpdateFrequency.SettingChanged += delegate { CullingMethod.Initialize(); }; DisableShadowDistanceFading.SettingChanged += delegate { RefreshCullingInfoAndMethod(); }; DisableLODCulling.SettingChanged += delegate { RefreshCullingInfoAndMethod(); }; InteriorsToUseFallbackPortals.SettingChanged += delegate { UpdateInteriorsWithFallbackPortals(); }; InteriorsToSkipFallbackPortals.SettingChanged += delegate { UpdateInteriorsWithFallbackPortals(); }; CullDistanceEnabled.SettingChanged += delegate { TeleportExtender.SetInitialFarClipPlane(); }; CullDistance.SettingChanged += delegate { TeleportExtender.SetInitialFarClipPlane(); }; SurfaceCullDistance.SettingChanged += delegate { TeleportExtender.SetInitialFarClipPlane(); }; VisualizePortals.SettingChanged += delegate { CullingVisualizer.Initialize(); }; VisualizedPortalOutsetDistance.SettingChanged += delegate { CullingVisualizer.Initialize(); }; VisualizeTileBounds.SettingChanged += delegate { CullingVisualizer.Initialize(); }; UpdateMoonScenesWithDisabledCulling(); UpdateInteriorsWithDisabledCulling(); UpdateInteriorsWithFallbackPortals(); } private static string GetBuiltinBlacklistText(string[] blacklist) { if (blacklist.Length == 0) { return "This will have no effect as the internal blacklist is empty."; } return "This can be used to override the internal blacklist containing " + blacklist.HumanReadableList() + "."; } private static void MigrateSettings() { Version version = (File.Exists(VersionFile) ? Version.Parse(Encoding.UTF8.GetString(File.ReadAllBytes(VersionFile))) : DefaultVersion); if (version <= new Version(0, 8, 0)) { InteriorsToUseFallbackPortals.Value = InteriorsToUseFallbackPortals.Value.SplitByComma().Except(new <>z__ReadOnlyArray<string>(new string[2] { "CastleFlow", "SewerFlow" })).JoinByComma(); } if (version <= new Version(0, 8, 6)) { UpdateFrequency.Value = (float)((ConfigEntryBase)UpdateFrequency).DefaultValue; } using FileStream fileStream = File.Open(VersionFile, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None); fileStream.Write(Encoding.UTF8.GetBytes("2.0.0.2")); } private static void UpdateMoonScenesWithDisabledCulling() { MoonScenesWithDisabledCulling = DefaultMoonScenesToBlockCulling.Union(MoonScenesToBlockCulling.Value.SplitByComma()).Except(MoonScenesToForceCulling.Value.SplitByComma()).ToArray(); CullingMethod.Initialize(); } private static void UpdateInteriorsWithDisabledCulling() { InteriorsWithDisabledCulling = DefaultFlowsToBlockCulling.Union(InteriorsToBlockCulling.Value.SplitByComma()).Except(InteriorsToForceCulling.Value.SplitByComma()).ToArray(); CullingMethod.Initialize(); } public static bool ShouldEnableCullingForScene(string sceneName) { return !MoonScenesWithDisabledCulling.Contains(sceneName); } public static bool ShouldEnableCullingForInterior(string dungeonFlowName) { return !InteriorsWithDisabledCulling.Contains(dungeonFlowName); } public static CullingType GetCullingType() { return Culler.Value; } private static void UpdateInteriorsWithFallbackPortals() { InteriorsWithFallbackPortals = BaseSetOfInteriorsToUseFallbackPortals.Union(InteriorsToUseFallbackPortals.Value.SplitByComma()).Except(InteriorsToSkipFallbackPortals.Value.SplitByComma()).ToArray(); RefreshCullingInfoAndMethod(); } private static void RefreshCullingInfoAndMethod() { DungeonCullingInfo.RefreshCullingInfo(); CullingMethod.Initialize(); } } [BepInPlugin("com.fumiko.CullFactory", "CullFactory", "2.0.0.2")] public class Plugin : BaseUnityPlugin { public const string Guid = "com.fumiko.CullFactory"; public const string Name = "CullFactory"; public const string Version = "2.0.0.2"; private Harmony _harmony = new Harmony("com.fumiko.CullFactory"); public static Plugin Instance { get; private set; } private void Awake() { Instance = this; Config.Initialize(((BaseUnityPlugin)this).Config); _harmony.PatchAll(typeof(LevelGenerationExtender)); _harmony.PatchAll(typeof(TeleportExtender)); _harmony.PatchAll(typeof(MapSeedOverride)); _harmony.PatchAll(typeof(GrabbableObjectExtender)); QualitySettings.shadowResolution = (ShadowResolution)0; LoadBurstAssembly(); SceneLoadingExtender.Init(); Log("Plugin CullFactory is loaded!"); } private void LoadBurstAssembly() { string text = Path.Combine(new FileInfo(((BaseUnityPlugin)this).Info.Location).DirectoryName, "lib_burst_generated.data"); if (!File.Exists(text)) { LogError("CullFactory's Burst assembly 'lib_burst_generated.data' was not found, culling may be slower than normal."); return; } if (!BurstRuntime.LoadAdditionalLibrary(text)) { LogError("CullFactory's Burst assembly failed to load, culling may be slower than normal."); return; } if (!Plugin.IsRunningBurstLibrary()) { LogError("CullFactory's Burst plugin is not running its Burst-compiled code, culling may be slower than normal."); return; } LogAlways("Loaded CullFactory's Burst assembly."); _harmony.PatchAll(typeof(BurstErrorPrevention)); } public static void LogAlways(string s) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)s); } public static void Log(string s) { if (Config.Logging.Value) { LogAlways(s); } } public static void LogWarning(string s) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)s); } public static void LogError(string s) { ((BaseUnityPlugin)Instance).Logger.LogError((object)s); } } } namespace CullFactory.Services { public static class BoundsUtility { private struct AABBFrustumEdge { internal int FaceA; internal int FaceB; internal int VertA; internal int VertB; public AABBFrustumEdge(int faceA, int faceB, int vertA, int vertB) { FaceA = faceA; FaceB = faceB; VertA = vertA; VertB = vertB; } } private struct AABBFrustumData { internal Vector3[] Normals; internal Vector3[] Vertices; internal AABBFrustumEdge[] Edges; } private static readonly AABBFrustumData FrustumData = GetFrustumData(); private static readonly List<Plane> TempPlanes = new List<Plane>(9); public static Plane[] GetPlanes(this in Bounds bounds) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) Plane[] array = new Plane[6]; Vector3 val = new Vector3(1f, 0f, 0f); Bounds val2 = bounds; array[0] = new Plane(val, 0f - ((Bounds)(ref val2)).min.x); Vector3 val3 = new Vector3(0f, 1f, 0f); val2 = bounds; array[1] = new Plane(val3, 0f - ((Bounds)(ref val2)).min.y); Vector3 val4 = new Vector3(0f, 0f, 1f); val2 = bounds; array[2] = new Plane(val4, 0f - ((Bounds)(ref val2)).min.z); Vector3 val5 = new Vector3(-1f, 0f, 0f); val2 = bounds; array[3] = new Plane(val5, ((Bounds)(ref val2)).max.x); Vector3 val6 = new Vector3(0f, -1f, 0f); val2 = bounds; array[4] = new Plane(val6, ((Bounds)(ref val2)).max.y); Vector3 val7 = new Vector3(0f, 0f, -1f); val2 = bounds; array[5] = new Plane(val7, ((Bounds)(ref val2)).max.z); return (Plane[])(object)array; } public static Vector3[] GetVertices(Vector3 min, Vector3 max) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) return (Vector3[])(object)new Vector3[8] { new Vector3(min.x, min.y, min.z), new Vector3(max.x, min.y, min.z), new Vector3(min.x, max.y, min.z), new Vector3(max.x, max.y, min.z), new Vector3(min.x, min.y, max.z), new Vector3(max.x, min.y, max.z), new Vector3(min.x, max.y, max.z), new Vector3(max.x, max.y, max.z) }; } public static Vector3[] GetVertices(this Bounds bounds) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) return GetVertices(((Bounds)(ref bounds)).min, ((Bounds)(ref bounds)).max); } private static AABBFrustumData GetFrustumData() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[6] { Vector3.right, Vector3.up, Vector3.forward, Vector3.left, Vector3.down, Vector3.back }; List<Vector3> verts = new List<Vector3>(8); List<AABBFrustumEdge> list = new List<AABBFrustumEdge>(12); for (int i = 0; i < array.Length; i++) { Vector3 val = array[i]; for (int j = 0; j < array.Length; j++) { Vector3 val2 = array[j]; if (!(Vector3.Dot(val, val2) < 0f)) { Vector3 val3 = Vector3.Cross(val, val2); Vector3 vert2 = val + val2 + val3; Vector3 vert3 = val + val2 - val3; int vertA = AddVert(vert2); int vertB = AddVert(vert3); list.Add(new AABBFrustumEdge(i, j, vertA, vertB)); } } } AABBFrustumData result = default(AABBFrustumData); result.Normals = array; result.Vertices = verts.ToArray(); result.Edges = list.ToArray(); return result; int AddVert(Vector3 vert) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) int num = verts.IndexOf(vert); if (num != -1) { return num; } num = verts.Count; verts.Add(vert); return num; } } private static bool IsFacing(in Bounds bounds, in Vector3 normal, in Vector3 point) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Bounds val = bounds; Vector3 center = ((Bounds)(ref val)).center; val = bounds; Vector3 val2 = center + Vector3.Scale(((Bounds)(ref val)).extents, normal) - point; return Vector3.Dot(normal, val2) < 0f; } public static Plane[] GetFrustumFromPoint(this in Bounds bounds, Vector3 point) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) Bounds val = bounds; if (((Bounds)(ref val)).Contains(point)) { return bounds.GetPlanes(); } TempPlanes.Clear(); bounds.AddInsidePlanesFacingPointToTempPlanes(in point); AABBFrustumEdge[] edges = FrustumData.Edges; for (int i = 0; i < edges.Length; i++) { AABBFrustumEdge aABBFrustumEdge = edges[i]; Vector3 normal = FrustumData.Normals[aABBFrustumEdge.FaceA]; Vector3 normal2 = FrustumData.Normals[aABBFrustumEdge.FaceB]; if (IsFacing(in bounds, in normal, in point) && !IsFacing(in bounds, in normal2, in point)) { val = bounds; Vector3 center = ((Bounds)(ref val)).center; Vector3 val2 = FrustumData.Vertices[aABBFrustumEdge.VertA]; val = bounds; Vector3 val3 = center + Vector3.Scale(val2, ((Bounds)(ref val)).extents); val = bounds; Vector3 center2 = ((Bounds)(ref val)).center; Vector3 val4 = FrustumData.Vertices[aABBFrustumEdge.VertB]; val = bounds; Vector3 val5 = center2 + Vector3.Scale(val4, ((Bounds)(ref val)).extents); TempPlanes.Add(new Plane(val3, val5, point)); } } return TempPlanes.ToArray(); } public static void AddInsidePlanesFacingPointToTempPlanes(this in Bounds bounds, in Vector3 point) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) Vector3[] normals = FrustumData.Normals; for (int i = 0; i < normals.Length; i++) { Vector3 normal = normals[i]; if (!IsFacing(in bounds, in normal, in point)) { List<Plane> tempPlanes = TempPlanes; Vector3 val = -normal; Bounds val2 = bounds; Vector3 center = ((Bounds)(ref val2)).center; val2 = bounds; tempPlanes.Add(new Plane(val, center + Vector3.Scale(((Bounds)(ref val2)).extents, normal))); } } } public static Plane[] GetInsidePlanesFacingPoint(this in Bounds bounds, in Vector3 point) { TempPlanes.Clear(); bounds.AddInsidePlanesFacingPointToTempPlanes(in point); return TempPlanes.ToArray(); } } internal static class CameraUtility { private static NativeArray<Plane> TempFrustum; public unsafe static NativeSlice<Plane> GetTempFrustum(this Camera camera) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (TempFrustum.Length == 0) { TempFrustum = new NativeArray<Plane>(6, (Allocator)4, (NativeArrayOptions)0); } camera.ExtractFrustumPlanes(TempFrustum.GetPtr<Plane>()); return NativeSlice<Plane>.op_Implicit(TempFrustum); } public unsafe static void ExtractFrustumPlanes(this Camera camera, Plane* planes) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 val = camera.projectionMatrix * camera.worldToCameraMatrix; Geometry.ExtractPlanes(ref val, planes); } public unsafe static void ExtractFrustumPlanes(this Camera camera, NativeArray<Plane> planes) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) camera.ExtractFrustumPlanes(planes.GetPtr<Plane>()); } } public class IdentityEqualityComparer<T> : IEqualityComparer<T> { public static readonly IdentityEqualityComparer<T> Instance = new IdentityEqualityComparer<T>(); public bool Equals(T x, T y) { return (object)x == (object)y; } public int GetHashCode(T obj) { return RuntimeHelpers.GetHashCode(obj); } } public static class LightUtility { public static bool Affects(this Light light, Bounds bounds) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) float range = light.range; if (((Bounds)(ref bounds)).SqrDistance(((Component)light).transform.position) > range * range) { return false; } if ((int)light.type == 0) { return Geometry.SpotLightInfluencesBounds(ref light, ref bounds); } return true; } public static bool Affects(this Light light, TileContents tile) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return light.Affects(tile.rendererBounds); } public static bool Affects(this Light light, IEnumerable<TileContents> tiles) { foreach (TileContents tile in tiles) { if (light.Affects(tile)) { return true; } } return false; } public static bool HasShadows(this Light light) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 return (int)light.shadows > 0; } public static bool PassesThroughOccluders(this Light light) { if (light.HasShadows()) { HDAdditionalLightData component = ((Component)light).GetComponent<HDAdditionalLightData>(); if (component != null) { return component.shadowDimmer < 1f; } return false; } return true; } public static void SetVisible(this Light light, bool visible) { if (!((Object)(object)light == (Object)null)) { if (light.cullingMask != -1 && light.cullingMask != 0) { Plugin.LogWarning($"Light {((Object)light).name}'s culling mask was an unexpected value of {light.cullingMask}."); } light.cullingMask = (visible ? (-1) : 0); } } public static void SetVisible(this IEnumerable<Light> lights, bool visible) { foreach (Light light in lights) { light.SetVisible(visible); } } } internal static class NativeCollectionsUtility { public unsafe static T* GetPtr<T>(this NativeArray<T> array) where T : unmanaged { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return (T*)NativeArrayUnsafeUtility.GetUnsafePtr<T>(array); } public unsafe static T* GetPtr<T>(this NativeSlice<T> array) where T : unmanaged { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return (T*)NativeSliceUnsafeUtility.GetUnsafePtr<T>(array); } } public static class ObjectContentsUtility { public static void SetSelfVisible(this IEnumerable<TileContents> tiles, bool visible) { foreach (TileContents tile in tiles) { tile.SetSelfVisible(visible); } } public static void SetVisible(this IEnumerable<GrabbableObjectContents> items, bool visible) { foreach (GrabbableObjectContents item in items) { item.SetVisible(visible); } } public static void AddContentsVisibleToCamera(this ICollection<TileContents> result, Camera camera) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (camera.orthographic) { result.AddContentsWithinCameraFrustum(camera); return; } TileContents tileContents = ((Component)camera).transform.position.GetTileContents(); if (tileContents != null) { VisibilityTesting.CallForEachLineOfSight(camera, tileContents, delegate(TileContents[] tiles, NativeSlice<Plane>[] frustums, int index) { result.Add(tiles[index]); }); } } public static void AddContentsWithinCameraFrustum(this ICollection<TileContents> result, Camera camera) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) NativeSlice<Plane> tempFrustum = camera.GetTempFrustum(); for (int i = 0; i < DungeonCullingInfo.AllDungeonData.Length; i++) { ref DungeonCullingInfo.DungeonData reference = ref DungeonCullingInfo.AllDungeonData[i]; if (!reference.IsValid || !Geometry.TestPlanesAABB(ref tempFrustum, ref reference.Bounds)) { continue; } TileContents[] allTileContents = reference.AllTileContents; foreach (TileContents tileContents in allTileContents) { if (Geometry.TestPlanesAABB(ref tempFrustum, ref tileContents.bounds)) { result.Add(tileContents); } } } } } public static class StringUtility { public static IEnumerable<string> SplitByComma(this string input) { return from name in input.Split(',', StringSplitOptions.RemoveEmptyEntries) select name.Trim().Trim('"'); } public static string JoinByComma(this IEnumerable<string> input) { return string.Join(", ", input); } public static string HumanReadableList(this IEnumerable<string> input) { IEnumerator<string> enumerator = input.GetEnumerator(); if (!enumerator.MoveNext()) { return ""; } StringBuilder stringBuilder = new StringBuilder(enumerator.Current); if (!enumerator.MoveNext()) { return stringBuilder.ToString(); } string current; while (true) { current = enumerator.Current; if (!enumerator.MoveNext()) { break; } stringBuilder.Append(", "); stringBuilder.Append(current); } stringBuilder.Append(", and "); stringBuilder.Append(current); return stringBuilder.ToString(); } } public static class TransformUtility { public static string GetPath(this Transform obj) { StringBuilder stringBuilder = new StringBuilder(((Object)obj).name); Transform parent = obj.parent; while ((Object)(object)parent != (Object)null) { stringBuilder.Insert(0, "/"); stringBuilder.Insert(0, ((Object)parent).name); parent = parent.parent; } return stringBuilder.ToString(); } public static bool TryGetComponentInParent<T>(this Transform transform, out T component) { component = ((Component)transform).GetComponentInParent<T>(); return component != null; } } public static class VisibilityTesting { public delegate void LineOfSightCallback(TileContents[] tileStack, NativeSlice<Plane>[] frustums, int stackIndex); private const int MaxStackCapacity = 16; private static readonly TileContents[] TileStack = new TileContents[16]; private static readonly int[] IndexStack = new int[16]; private static readonly NativeSlice<Plane>[] Frustums = new NativeSlice<Plane>[16]; private static readonly NativeArray<Plane> FrustumPlanes = new NativeArray<Plane>(96, (Allocator)4, (NativeArrayOptions)1); private static bool warnedThatStackWasExceeded = false; [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void DropTopStackFrame(ref int stackIndex, ref int frustumPlanesCount) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) frustumPlanesCount -= Frustums[stackIndex].Length; Frustums[stackIndex] = default(NativeSlice<Plane>); stackIndex--; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private unsafe static bool AdvanceToNextTile(Vector3 origin, ref int stackIndex, ref int frustumPlanesCount) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) TileContents tileContents = TileStack[stackIndex]; int num = IndexStack[stackIndex]++; if (num >= tileContents.portals.Length) { DropTopStackFrame(ref stackIndex, ref frustumPlanesCount); return false; } Portal portal = tileContents.portals[num]; TileContents nextTile = portal.NextTile; if (nextTile == null) { return false; } if (stackIndex > 0 && nextTile == TileStack[stackIndex - 1]) { return false; } NativeSlice<Plane> val = NativeSliceExtensions.Slice<Plane>(FrustumPlanes, 0, frustumPlanesCount); if (!Geometry.TestPlanesAABB(ref val, ref portal.Bounds)) { return false; } stackIndex++; if (stackIndex >= 16) { DropTopStackFrame(ref stackIndex, ref frustumPlanesCount); if (!warnedThatStackWasExceeded) { Plugin.LogWarning($"Exceeded the maximum portal occlusion culling depth of {16}."); warnedThatStackWasExceeded = true; } return false; } TileStack[stackIndex] = nextTile; IndexStack[stackIndex] = 0; int frustumPlanes = portal.GetFrustumPlanes(in origin, NativeSliceExtensions.Slice<Plane>(FrustumPlanes, frustumPlanesCount).GetPtr<Plane>()); Frustums[stackIndex] = NativeSliceExtensions.Slice<Plane>(FrustumPlanes, frustumPlanesCount, frustumPlanes); frustumPlanesCount += frustumPlanes; return true; } public static void CallForEachLineOfSight(Vector3 origin, TileContents originTile, NativeSlice<Plane> frustum, LineOfSightCallback callback) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) TileStack[0] = originTile; IndexStack[0] = 0; frustum.CopyTo(FrustumPlanes); Frustums[0] = NativeSliceExtensions.Slice<Plane>(FrustumPlanes, 0, frustum.Length); int stackIndex = 0; int frustumPlanesCount = frustum.Length; callback(TileStack, Frustums, stackIndex); while (stackIndex >= 0) { if (AdvanceToNextTile(origin, ref stackIndex, ref frustumPlanesCount)) { callback(TileStack, Frustums, stackIndex); } } } public static void CallForEachLineOfSight(Camera camera, TileContents originTile, LineOfSightCallback callback) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) TileStack[0] = originTile; IndexStack[0] = 0; Frustums[0] = NativeSliceExtensions.Slice<Plane>(FrustumPlanes, 0, 6); camera.ExtractFrustumPlanes(FrustumPlanes); int stackIndex = 0; int frustumPlanesCount = 6; callback(TileStack, Frustums, stackIndex); Vector3 position = ((Component)camera).transform.position; while (stackIndex >= 0) { if (AdvanceToNextTile(position, ref stackIndex, ref frustumPlanesCount)) { callback(TileStack, Frustums, stackIndex); } } CallForEachLineOfSight(((Component)camera).transform.position, originTile, camera.GetTempFrustum(), callback); } public static void CallForEachLineOfSight(Vector3 origin, TileContents originTile, LineOfSightCallback callback) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) TileStack[0] = originTile; IndexStack[0] = 0; Frustums[0] = default(NativeSlice<Plane>); int stackIndex = 0; int frustumPlanesCount = 0; callback(TileStack, Frustums, stackIndex); while (stackIndex >= 0) { if (AdvanceToNextTile(origin, ref stackIndex, ref frustumPlanesCount)) { callback(TileStack, Frustums, stackIndex); } } } private static bool PlanesIntersectAnyTile(in NativeSlice<Plane> planes, HashSet<TileContents> tiles) { foreach (TileContents tile in tiles) { if (Geometry.TestPlanesAABB(ref planes, ref tile.bounds)) { return true; } } return false; } public static bool CallForEachLineOfSightTowardTiles(Vector3 origin, TileContents originTile, NativeSlice<Plane> frustum, HashSet<TileContents> goalTiles, LineOfSightCallback callback) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) TileStack[0] = originTile; IndexStack[0] = 0; frustum.CopyTo(FrustumPlanes); Frustums[0] = NativeSliceExtensions.Slice<Plane>(FrustumPlanes, 0, frustum.Length); int stackIndex = 0; int frustumPlanesCount = frustum.Length; callback(TileStack, Frustums, stackIndex); bool result = goalTiles.Contains(originTile); while (stackIndex >= 0) { if (!AdvanceToNextTile(origin, ref stackIndex, ref frustumPlanesCount)) { continue; } if (!PlanesIntersectAnyTile(in Frustums[stackIndex], goalTiles)) { DropTopStackFrame(ref stackIndex, ref frustumPlanesCount); continue; } if (goalTiles.Contains(TileStack[stackIndex])) { result = true; } callback(TileStack, Frustums, stackIndex); } return result; } public static bool CallForEachLineOfSightTowardTiles(Vector3 origin, TileContents originTile, HashSet<TileContents> goalTiles, LineOfSightCallback callback) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return CallForEachLineOfSightTowardTiles(origin, originTile, default(NativeSlice<Plane>), goalTiles, callback); } } } namespace CullFactory.Extenders { internal static class BurstErrorPrevention { [HarmonyTranspiler] [HarmonyPatch(typeof(BurstCompiler), "GetILPPMethodFunctionPointer2")] private static IEnumerable<CodeInstruction> PatchGetILPPMethodFunctionPointer2(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"ilppMethod", (string)null), new CodeMatch((OpCode?)OpCodes.Newobj, (object)typeof(ArgumentNullException).GetConstructor(new Type[1] { typeof(string) }), (string)null), new CodeMatch((OpCode?)OpCodes.Throw, (object)null, (string)null) }); if (val.IsInvalid) { Plugin.LogError("Failed to find Burst function pointer getter's throw statement"); return instructions; } val.RemoveInstructions(3).Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldc_I4_0, (object)null), new CodeInstruction(OpCodes.Ret, (object)null) }); return val.Instructions(); } [HarmonyTranspiler] [HarmonyPatch(typeof(BurstCompiler), "Compile", new Type[] { typeof(object), typeof(MethodInfo), typeof(bool), typeof(bool) })] private static IEnumerable<CodeInstruction> PatchCompile(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Expected O, but got Unknown //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); MethodInfo method = typeof(BurstCompilerService).GetMethod("GetAsyncCompiledAsyncDelegateMethod", new Type[1] { typeof(int) }); if (method == null) { Plugin.LogError("Failed to find the Burst async compilation method"); return instructions; } val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[2] { new CodeMatch((OpCode?)OpCodes.Call, (object)method, (string)null), new CodeMatch((OpCode?)OpCodes.Stloc_0, (object)null, (string)null) }).Advance(1); Label? label = default(Label?); if (val.IsInvalid || !CodeInstructionExtensions.Branches(val.Instruction, ref label)) { Plugin.LogAlways($"{val.Instruction}"); Plugin.LogError("Failed to find the call to the Burst async compilation method"); return instructions; } val.RemoveInstruction().InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldloc_0, (object)null), new CodeInstruction(OpCodes.Ldc_I4_0, (object)null), new CodeInstruction(OpCodes.Conv_U, (object)null), new CodeInstruction(OpCodes.Bne_Un, (object)label) }); CodeMatch[] array = (CodeMatch[])(object)new CodeMatch[9] { new CodeMatch((OpCode?)OpCodes.Ldloc_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Conv_U, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Bne_Un, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldstr, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_1, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)typeof(string).GetMethod("Format", new Type[2] { typeof(string), typeof(object) }), (string)null), new CodeMatch((OpCode?)OpCodes.Newobj, (object)typeof(InvalidOperationException).GetConstructor(new Type[1] { typeof(string) }), (string)null), new CodeMatch((OpCode?)OpCodes.Throw, (object)null, (string)null) }; val.MatchForward(false, array); if (val.IsInvalid) { Plugin.LogError("Failed to find Burst compilation failure throw statement"); return instructions; } List<Label> labels = val.Instruction.labels; val.RemoveInstructions(array.Length).Labels.AddRange(labels); return val.Instructions(); } } [HarmonyPatch(typeof(GrabbableObject))] internal static class GrabbableObjectExtender { [HarmonyPostfix] [HarmonyPatch("Start")] private static void GrabbableObjectStarted(GrabbableObject __instance) { DynamicObjects.MarkGrabbableObjectDirty(__instance); } [HarmonyPostfix] [HarmonyPatch("FallToGround")] private static void GrabbableObjectFalling(GrabbableObject __instance) { DynamicObjects.MarkGrabbableObjectDirty(__instance); } [HarmonyPostfix] [HarmonyPatch("EnablePhysics")] private static void GrabbableObjectDropped(GrabbableObject __instance) { DynamicObjects.MarkGrabbableObjectDirty(__instance); } [HarmonyPostfix] [HarmonyPatch("EnableItemMeshes")] private static void GrabbableObjectShownOrHidden(GrabbableObject __instance) { DynamicObjects.MarkGrabbableObjectDirty(__instance); } [HarmonyPostfix] [HarmonyPatch("GrabItemFromEnemy")] private static void GrabbableObjectPickedUpByEnemy(GrabbableObject __instance) { DynamicObjects.MarkGrabbableObjectDirty(__instance); } [HarmonyPostfix] [HarmonyPatch("DiscardItemFromEnemy")] private static void GrabbableObjectDroppedByEnemy(GrabbableObject __instance) { DynamicObjects.MarkGrabbableObjectDirty(__instance); } } public static class LevelGenerationExtender { private static bool PauseCullingUpdates; [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "GenerateNewLevelClientRpc")] private static void OnLevelBeginGenerating(RoundManager __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 if (!((Object)(object)((NetworkBehaviour)__instance).NetworkManager == (Object)null) && ((NetworkBehaviour)__instance).NetworkManager.IsListening && (int)((NetworkBehaviour)__instance).__rpc_exec_stage == 2) { PauseCullingUpdates = true; } } [HarmonyPostfix] [HarmonyPatch(typeof(DungeonGenerator), "ChangeStatus")] private static void OnDungeonGenerated(DungeonGenerator __instance, GenerationStatus status) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 if (!PauseCullingUpdates && (int)status == 6) { DungeonCullingInfo.OnDungeonGenerated(__instance.CurrentDungeon); } } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "SetLevelObjectVariables")] private static void OnLevelGenerated() { Plugin.LogAlways($"Generation has completed with seed {StartOfRound.Instance.randomMapSeed}."); PauseCullingUpdates = false; DungeonCullingInfo.RefreshCullingInfo(); DynamicObjects.CollectAllTrackedObjects(); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "PassTimeToNextDay")] private static void OnRoundEnded() { DungeonCullingInfo.CleanUpDestroyedDungeons(); DynamicObjects.CollectAllTrackedObjects(); } } internal static class MapSeedOverride { [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPostfix] private static void StartOfRound_StartPostfix(StartOfRound __instance) { if (int.TryParse(Config.OverrideMapSeed.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var result)) { __instance.overrideRandomSeed = true; __instance.overrideSeedNumber = result; } else { __instance.overrideRandomSeed = false; } } } internal static class SceneLoadingExtender { internal static void Init() { SceneManager.sceneLoaded += OnSceneLoaded; } private static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 if ((int)mode == 1) { CullingMethod.Initialize(); } } } [HarmonyPatch(typeof(EntranceTeleport))] public static class TeleportExtender { private static float[] _initialPlayerCameraFarPlanes; public static void SetInitialFarClipPlane() { if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; if (_initialPlayerCameraFarPlanes == null) { _initialPlayerCameraFarPlanes = new float[allPlayerScripts.Length]; for (int i = 0; i < allPlayerScripts.Length; i++) { _initialPlayerCameraFarPlanes[i] = allPlayerScripts[i].gameplayCamera.farClipPlane; } } if (!Config.CullDistanceEnabled.Value) { for (int j = 0; j < allPlayerScripts.Length; j++) { allPlayerScripts[j].gameplayCamera.farClipPlane = _initialPlayerCameraFarPlanes[j]; } } else { for (int k = 0; k < allPlayerScripts.Length; k++) { UpdateFarPlane(allPlayerScripts[k]); } } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void GameStarted() { SetInitialFarClipPlane(); DynamicObjects.CollectAllPlayerLights(); } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "TeleportPlayer")] private static void OnTeleportPlayerController(PlayerControllerB __instance) { OnPlayerTeleported(__instance); } [HarmonyPostfix] [HarmonyPatch(typeof(EntranceTeleport), "TeleportPlayerClientRpc")] private static void OnTeleportOtherPlayerThroughEntrance(ref int playerObj) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj]; if (!((Object)(object)val == (Object)(object)StartOfRound.Instance.localPlayerController)) { OnPlayerTeleported(val); } } private static void OnPlayerTeleported(PlayerControllerB player) { UpdateFarPlane(player); DynamicObjects.OnPlayerTeleported(player); } [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "SetEnemyOutside")] private static void OnEnemySetOutsideOrInside(EnemyAI __instance) { OnEnemyTeleported(__instance); } private static void OnEnemyTeleported(EnemyAI enemy) { DynamicObjects.OnEnemyTeleported(enemy); } private static void UpdateFarPlane(PlayerControllerB player) { if (Config.CullDistanceEnabled.Value) { player.gameplayCamera.farClipPlane = (DynamicObjects.PlayerIsInAnyInterior(player) ? Config.CullDistance.Value : Config.SurfaceCullDistance.Value); Plugin.Log(string.Format("{0} is{1} in the factory, set far plane distance to {2}", player.playerUsername, player.isInsideFactory ? string.Empty : " not", player.gameplayCamera.farClipPlane)); } } } } namespace CullFactory.Data { public enum CullingType { None, PortalOcclusionCulling, DepthCulling } internal static class DungeonCullingInfo { internal struct DungeonData { public WeakReference<Dungeon> DungeonRef; public Bounds Bounds; public readonly bool IsValid { get { if (DungeonRef.TryGetTarget(out var target)) { return (Object)(object)target != (Object)null; } return false; } } public TileContents[] AllTileContents { get; internal set; } public Dictionary<Tile, TileContents> TileContentsForTile { get; internal set; } public Light[] AllLightsInDungeon { get; internal set; } public DungeonData(Dungeon dungeon) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) Bounds = default(Bounds); AllTileContents = null; TileContentsForTile = null; AllLightsInDungeon = null; DungeonRef = new WeakReference<Dungeon>(dungeon); } } private readonly struct LightInfluenceCollections { internal readonly HashSet<Renderer> _externalRenderers; internal readonly List<Light> _externalLights; internal readonly List<Plane[]> _externalLightLinesOfSight; public LightInfluenceCollections(TileContents tileContents) { _externalRenderers = new HashSet<Renderer>(tileContents.externalRenderers); _externalLights = new List<Light>(tileContents.externalLights); _externalLightLinesOfSight = new List<Plane[]>(tileContents.externalLightLinesOfSight); } } private const int RendererIntrusionTileDepth = 2; private const float RendererIntrusionDistance = 0.01f; public static DungeonData[] AllDungeonData = Array.Empty<DungeonData>(); public static void OnDungeonGenerated(Dungeon dungeon) { CollectDungeonData(dungeon); CullingMethod.Initialize(); } public static void RefreshCullingInfo() { AllDungeonData = Array.Empty<DungeonData>(); Dungeon[] array = Object.FindObjectsOfType<Dungeon>(); for (int i = 0; i < array.Length; i++) { CollectDungeonData(array[i]); } CullingMethod.Initialize(); } private static void CollectDungeonData(Dungeon dungeon) { DungeonData data = new DungeonData(dungeon); DungeonFlow dungeonFlow = dungeon.DungeonFlow; if ((Object)(object)dungeonFlow == (Object)null) { Plugin.LogError($"Dungeon flow for {dungeon} was null!"); return; } string name = ((Object)dungeonFlow).name; if (name == null || Config.ShouldEnableCullingForInterior(name)) { bool flag = Array.IndexOf(Config.InteriorsWithFallbackPortals, name) != -1; if (flag) { Plugin.LogAlways("Using tile bounds to determine the size of portals for " + name + "."); } float realtimeSinceStartup = Time.realtimeSinceStartup; CollectAllTileContents(dungeon, flag, ref data); Plugin.Log($"Preparing tile information for {name} took {(Time.realtimeSinceStartup - realtimeSinceStartup) * 1000f:0.###}ms"); DungeonData[] allDungeonData = AllDungeonData; int num = 0; DungeonData[] array = new DungeonData[1 + allDungeonData.Length]; ReadOnlySpan<DungeonData> readOnlySpan = new ReadOnlySpan<DungeonData>(allDungeonData); readOnlySpan.CopyTo(new Span<DungeonData>(array).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; array[num] = data; AllDungeonData = array; } } public static void CleanUpDestroyedDungeons() { List<DungeonData> list = new List<DungeonData>(AllDungeonData); for (int num = AllDungeonData.Length - 1; num >= 0; num--) { if (!AllDungeonData[num].IsValid) { list.RemoveAt(num); } } AllDungeonData = list.ToArray(); } private static void AddIntersectingRenderers(Bounds bounds, HashSet<Renderer> toCollection, HashSet<TileContents> visitedTiles, TileContents currentTile, int tilesLeft) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!visitedTiles.Add(currentTile)) { return; } Renderer[] renderers = currentTile.renderers; foreach (Renderer val in renderers) { Bounds bounds2 = val.bounds; if (((Bounds)(ref bounds2)).Intersects(bounds)) { toCollection.Add(val); } } if (--tilesLeft > 0) { Portal[] portals = currentTile.portals; foreach (Portal portal in portals) { AddIntersectingRenderers(bounds, toCollection, visitedTiles, portal.NextTile, tilesLeft - 1); } } visitedTiles.Remove(currentTile); } private static HashSet<Renderer> GetIntrudingRenderers(TileContents originTile) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) HashSet<Renderer> hashSet = new HashSet<Renderer>(); Bounds bounds = originTile.bounds; ((Bounds)(ref bounds)).Expand(-0.01f); HashSet<TileContents> visitedTiles = new HashSet<TileContents> { originTile }; Portal[] portals = originTile.portals; foreach (Portal portal in portals) { AddIntersectingRenderers(bounds, hashSet, visitedTiles, portal.NextTile, 2); } return hashSet; } internal static bool ShouldShadowFadingBeDisabledForLight(HDAdditionalLightData light) { return (double)light.shadowFadeDistance >= (double)light.fadeDistance * 0.75 - 15.0; } internal static bool ShouldShadowFadingBeDisabledForLight(Light light) { if (!Config.DisableShadowDistanceFading.Value) { return false; } HDAdditionalLightData component = ((Component)light).GetComponent<HDAdditionalLightData>(); if (component != null) { return ShouldShadowFadingBeDisabledForLight(component); } return true; } private static void CollectAllTileContents(Dungeon dungeon, bool derivePortalBoundsFromTile, ref DungeonData data) { FillTileContentsCollections(dungeon, ref data); CreateAndAssignPortals(derivePortalBoundsFromTile, ref data); AddIntrudingRenderersToTileContents(ref data); AddLightInfluencesToTileContents(ref data); } private static void FillTileContentsCollections(Dungeon dungeon, ref DungeonData data) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) ReadOnlyCollection<Tile> allTiles = dungeon.AllTiles; data.AllTileContents = new TileContents[allTiles.Count]; data.TileContentsForTile = new Dictionary<Tile, TileContents>(data.AllTileContents.Length); List<Light> list = new List<Light>(); Vector3 val = Vector3.positiveInfinity; Vector3 val2 = Vector3.negativeInfinity; int num = 0; foreach (Tile item in allTiles) { TileContents tileContents = new TileContents(item); data.AllTileContents[num++] = tileContents; data.TileContentsForTile[item] = tileContents; list.AddRange(tileContents.lights); Vector3 val3 = val; Bounds rendererBounds = tileContents.rendererBounds; val = Vector3.Min(val3, ((Bounds)(ref rendererBounds)).min); Vector3 val4 = val2; rendererBounds = tileContents.rendererBounds; val2 = Vector3.Max(val4, ((Bounds)(ref rendererBounds)).max); } data.AllLightsInDungeon = list.ToArray(); ((Bounds)(ref data.Bounds)).min = val; ((Bounds)(ref data.Bounds)).max = val2; } private static void CreateAndAssignPortals(bool derivePortalBoundsFromTile, ref DungeonData data) { foreach (TileContents value in data.TileContentsForTile.Values) { List<Doorway> usedDoorways = value.tile.UsedDoorways; int count = usedDoorways.Count; List<Portal> list = new List<Portal>(count); for (int i = 0; i < count; i++) { Doorway val = usedDoorways[i]; if (!((Object)(object)val.ConnectedDoorway == (Object)null)) { list.Add(new Portal(val, derivePortalBoundsFromTile, data.TileContentsForTile[val.ConnectedDoorway.Tile])); } } value.portals = list.ToArray(); } } private static void AddIntrudingRenderersToTileContents(ref DungeonData data) { for (int i = 0; i < data.AllTileContents.Length; i++) { TileContents tileContents; Renderer[] renderers = (tileContents = data.AllTileContents[i]).renderers; HashSet<Renderer> intrudingRenderers = GetIntrudingRenderers(data.AllTileContents[i]); int num = 0; Renderer[] array = (Renderer[])(object)new Renderer[renderers.Length + intrudingRenderers.Count]; ReadOnlySpan<Renderer> readOnlySpan = new ReadOnlySpan<Renderer>(renderers); readOnlySpan.CopyTo(new Span<Renderer>(array).Slice(num, readOnlySpan.Length)); num += readOnlySpan.Length; foreach (Renderer item in intrudingRenderers) { array[num] = item; num++; } tileContents.renderers = array; } } private static void AddLightInfluencesToTileContents(ref DungeonData data) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) Dictionary<TileContents, LightInfluenceCollections> lightInfluenceCollectionLookup = new Dictionary<TileContents, LightInfluenceCollections>(data.AllTileContents.Length); TileContents[] allTileContents = data.AllTileContents; foreach (TileContents tileContents in allTileContents) { lightInfluenceCollectionLookup[tileContents] = new LightInfluenceCollections(tileContents); } foreach (var item in data.AllTileContents.SelectMany((TileContents tile) => tile.lights.Select((Light light) => (tile, light)))) { var (tileContents2, light2) = item; if (!((Component)light2).gameObject.activeInHierarchy) { continue; } Vector3 lightOrigin = ((Component)light2).transform.position; Bounds bounds = tileContents2.bounds; if (!((Bounds)(ref bounds)).Contains(lightOrigin)) { allTileContents = data.AllTileContents; foreach (TileContents tileContents3 in allTileContents) { if (!light2.Affects(tileContents3)) { continue; } LightInfluenceCollections lightInfluenceCollections = lightInfluenceCollectionLookup[tileContents3]; lightInfluenceCollections._externalLights.Add(light2); if (!light2.HasShadows()) { continue; } Plane[] frustumFromPoint = tileContents3.bounds.GetFrustumFromPoint(lightOrigin); TileContents[] allTileContents2 = data.AllTileContents; foreach (TileContents tileContents4 in allTileContents2) { if (tileContents4 == tileContents3 || !light2.Affects(tileContents4)) { continue; } Renderer[] renderers = tileContents4.renderers; foreach (Renderer val in renderers) { if (light2.Affects(val.bounds)) { bounds = val.bounds; if (Geometry.TestPlanesAABB(ref frustumFromPoint, ref bounds)) { lightInfluenceCollections._externalRenderers.Add(val); } } } } } continue; } bool flag = light2.HasShadows(); bool lightPassesThroughWalls = !ShouldShadowFadingBeDisabledForLight(light2) || light2.PassesThroughOccluders(); if (lightPassesThroughWalls) { allTileContents = data.AllTileContents; foreach (TileContents tileContents5 in allTileContents) { if (light2.Affects(tileContents5)) { LightInfluenceCollections lightInfluenceCollections2 = lightInfluenceCollectionLookup[tileContents5]; lightInfluenceCollections2._externalLights.Add(light2); if (flag) { lightInfluenceCollections2._externalRenderers.UnionWith(tileContents2.renderers); } } } } if (!flag) { continue; } VisibilityTesting.CallForEachLineOfSight(lightOrigin, tileContents2, delegate(TileContents[] tiles, NativeSlice<Plane>[] frustums, int index) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if (index >= 1) { TileContents tileContents7 = tiles[index]; if (light2.Affects(tileContents7)) { bool flag2 = false; List<Renderer> list = new List<Renderer>(); for (int num = index - 1; num >= 0; num--) { Renderer[] renderers2 = tiles[num].renderers; foreach (Renderer val2 in renderers2) { Bounds bounds2 = val2.bounds; if (light2.Affects(bounds2)) { bool flag3 = true; for (int m = 0; m <= num; m++) { if (!Geometry.TestPlanesAABB(ref frustums[m], ref bounds2)) { flag3 = false; break; } } if (flag3) { flag2 = true; list.Add(val2); } } } } LightInfluenceCollections lightInfluenceCollections4 = lightInfluenceCollectionLookup[tileContents7]; lightInfluenceCollections4._externalRenderers.UnionWith(list); if (flag2) { List<Plane> list2 = new List<Plane>(); for (int n = 1; n <= index; n++) { list2.AddRange((IEnumerable<Plane>)(object)frustums[n]); } list2.AddRange(tileContents7.bounds.GetInsidePlanesFacingPoint(in lightOrigin)); lightInfluenceCollections4._externalLightLinesOfSight.Add(list2.ToArray()); if (!lightPassesThroughWalls) { lightInfluenceCollections4._externalLights.Add(light2); } } } } }); } allTileContents = data.AllTileContents; foreach (TileContents tileContents6 in allTileContents) { LightInfluenceCollections lightInfluenceCollections3 = lightInfluenceCollectionLookup[tileContents6]; tileContents6.externalRenderers = lightInfluenceCollections3._externalRenderers.ToArray(); tileContents6.externalLights = lightInfluenceCollections3._externalLights.ToArray(); tileContents6.externalLightLinesOfSight = lightInfluenceCollections3._externalLightLinesOfSight.ToArray(); } } public static bool PointIsInAnyInterior(Vector3 point) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < AllDungeonData.Length; i++) { ref DungeonData reference = ref AllDungeonData[i]; if (!reference.IsValid || !((Bounds)(ref reference.Bounds)).Contains(point)) { continue; } TileContents[] allTileContents = reference.AllTileContents; for (int j = 0; j < allTileContents.Length; j++) { Bounds rendererBounds = allTileContents[j].rendererBounds; if (((Bounds)(ref rendererBounds)).Contains(point)) { return true; } } } return false; } public static TileContents GetTileContents(this Vector3 point) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) TileContents result = null; for (int i = 0; i < AllDungeonData.Length; i++) { ref DungeonData reference = ref AllDungeonData[i]; if (!reference.IsValid || !((Bounds)(ref reference.Bounds)).Contains(point)) { continue; } TileContents[] allTileContents = reference.AllTileContents; foreach (TileContents tileContents in allTileContents) { Bounds val = tileContents.bounds; if (((Bounds)(ref val)).Contains(point)) { return tileContents; } val = tileContents.rendererBounds; if (((Bounds)(ref val)).Contains(point)) { result = tileContents; } } } return result; } public static void CollectAllTilesWithinCameraFrustum(Camera camera, List<TileContents> intoList) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) NativeSlice<Plane> tempFrustum = camera.GetTempFrustum(); for (int i = 0; i < AllDungeonData.Length; i++) { ref DungeonData reference = ref AllDungeonData[i]; if (!reference.IsValid) { continue; } TileContents[] allTileContents = reference.AllTileContents; foreach (TileContents tileContents in allTileContents) { if (Geometry.TestPlanesAABB(ref tempFrustum, ref tileContents.bounds)) { intoList.Add(tileContents); } } } } public static bool TryGetTileContentsForTile(Tile tile, out TileContents tileContents) { for (int i = 0; i < AllDungeonData.Length; i++) { ref DungeonData reference = ref AllDungeonData[i]; if (reference.IsValid && reference.TileContentsForTile.TryGetValue(tile, out tileContents)) { return true; } } tileContents = null; return false; } public static void SetAllTileContentsVisible(bool visible) { for (int i = 0; i < AllDungeonData.Length; i++) { if (AllDungeonData[i].IsValid) { AllDungeonData[i].AllTileContents.SetSelfVisible(visible); } } } } public static class DynamicObjects { public static readonly HashSet<Light> AllLightsOutside = new HashSet<Light>(); public static readonly HashSet<Light> AllLightsInInterior = new HashSet<Light>(); public static readonly HashSet<Light> AllUnpredictableLights = new HashSet<Light>(); public static HashSet<GrabbableObjectContents> AllGrabbableObjectContentsOutside = new HashSet<GrabbableObjectContents>(); public static HashSet<GrabbableObjectContents> AllGrabbableObjectContentsInInterior = new HashSet<GrabbableObjectContents>(); public static Dictionary<GrabbableObject, GrabbableObjectContents> GrabbableObjectToContents = new Dictionary<GrabbableObject, GrabbableObjectContents>(); public static Dictionary<EnemyAI, HashSet<GrabbableObjectContents>> ItemsHeldByEnemies = new Dictionary<EnemyAI, HashSet<GrabbableObjectContents>>(); private static Light[][] allPlayerLights; private static HashSet<GrabbableObjectContents> GrabbableObjectsToRefresh = new HashSet<GrabbableObjectContents>(); internal static void CollectAllPlayerLights() { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; int num = allPlayerScripts.Length; allPlayerLights = new Light[num][]; for (int i = 0; i < num; i++) { if (!((Object)(object)allPlayerScripts[i] == (Object)null)) { allPlayerLights[i] = ((Component)allPlayerScripts[i]).GetComponentsInChildren<Light>(true); } } } internal static void MarkGrabbableObjectDirty(GrabbableObject item) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (((Enum)((Object)item).hideFlags).HasFlag((Enum)(object)(HideFlags)52)) { return; } Scene scene = ((Component)item).gameObject.scene; if (((Scene)(ref scene)).isLoaded) { if (GrabbableObjectToContents.TryGetValue(item, out var value)) { AllLightsOutside.ExceptWith(value.lights); AllLightsInInterior.ExceptWith(value.lights); } else { Plugin.Log("Adding contents of " + ((Object)item).name); value = new GrabbableObjectContents(item); GrabbableObjectToContents[item] = value; } GrabbableObjectsToRefresh.Add(value); } } internal static void RefreshGrabbableObjects() { foreach (GrabbableObjectContents item in GrabbableObjectsToRefresh) { RefreshGrabbableObject(item); } GrabbableObjectsToRefresh.Clear(); } internal static void RefreshGrabbableObject(GrabbableObjectContents contents) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) GrabbableObject item = contents.item; if ((Object)(object)item == (Object)null) { return; } Plugin.Log($"Refreshing contents of {((Object)item).name} @ {((Component)item).transform.position}"); contents.SetVisible(visible: true); AllLightsOutside.ExceptWith(contents.lights); AllLightsInInterior.ExceptWith(contents.lights); AllGrabbableObjectContentsOutside.Remove(contents); AllGrabbableObjectContentsInInterior.Remove(contents); contents.CollectContents(); CullingMethod.Instance?.OnItemCreatedOrChanged(contents); Vector3 position = ((Component)item).transform.position; if ((Object)(object)item.parentObject != (Object)null) { position = item.parentObject.position; } if ((Object)(object)item.parentObject != (Object)null && ((Component)item.parentObject).transform.TryGetComponentInParent<EnemyAI>(out var component)) { contents.heldByEnemy = component; if (!ItemsHeldByEnemies.TryGetValue(component, out var value)) { ItemsHeldByEnemies.Add(component, value = new HashSet<GrabbableObjectContents>()); } value.Add(contents); } else if (contents.heldByEnemy != null) { if (ItemsHeldByEnemies.TryGetValue(contents.heldByEnemy, out var value2)) { value2.Remove(contents); } contents.heldByEnemy = null; } if (DungeonCullingInfo.PointIsInAnyInterior(position)) { AllLightsInInterior.UnionWith(contents.lights); AllGrabbableObjectContentsInInterior.Add(contents); } else { AllLightsOutside.UnionWith(contents.lights); AllGrabbableObjectContentsOutside.Add(contents); } } internal static bool PlayerIsInAnyInterior(PlayerControllerB player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return DungeonCullingInfo.PointIsInAnyInterior(((Component)player).transform.position); } internal static void OnPlayerTeleported(PlayerControllerB player) { CollectAllPlayerLights(); int num = Array.IndexOf(StartOfRound.Instance.allPlayerScripts, player); if (num == -1) { return; } Light[] other = allPlayerLights[num]; if (PlayerIsInAnyInterior(player)) { AllLightsOutside.ExceptWith(other); AllLightsInInterior.UnionWith(other); } else { AllLightsOutside.UnionWith(other); AllLightsInInterior.ExceptWith(other); } GrabbableObject[] itemSlots = player.ItemSlots; foreach (GrabbableObject val in itemSlots) { if (!((Object)(object)val == (Object)null)) { MarkGrabbableObjectDirty(val); } } } internal static void OnEnemyTeleported(EnemyAI enemy) { if (!ItemsHeldByEnemies.TryGetValue(enemy, out var value)) { return; } foreach (GrabbableObjectContents item in value) { if (!((Object)(object)item.item == (Object)null)) { MarkGrabbableObjectDirty(item.item); } } } private static IEnumerable<Light> FilterOutStaticLights(Light[] lights) { IEnumerable<Light> enumerable = lights.AsEnumerable(); for (int i = 0; i < DungeonCullingInfo.AllDungeonData.Length; i++) { ref DungeonCullingInfo.DungeonData reference = ref DungeonCullingInfo.AllDungeonData[i]; if (reference.IsValid) { enumerable = enumerable.Except(reference.AllLightsInDungeon); } } return enumerable; } private static void FillInteriorLights(IEnumerable<Light> lights, HashSet<Light> into) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < DungeonCullingInfo.AllDungeonData.Length; i++) { ref DungeonCullingInfo.DungeonData reference = ref DungeonCullingInfo.AllDungeonData[i]; if (!reference.IsValid) { continue; } foreach (Light light in lights) { Vector3 position = ((Component)light).transform.position; if (!((Bounds)(ref reference.Bounds)).Contains(position)) { continue; } TileContents[] allTileContents = reference.AllTileContents; for (int j = 0; j < allTileContents.Length; j++) { Bounds bounds = allTileContents[j].bounds; if (((Bounds)(ref bounds)).Contains(position)) { into.Add(light); } } } } } internal static void CollectAllLightsInWorld() { IEnumerable<Light> enumerable = FilterOutStaticLights(Object.FindObjectsByType<Light>((FindObjectsInactive)1, (FindObjectsSortMode)0)); FillInteriorLights(enumerable, AllLightsInInterior); AllLightsOutside.UnionWith(enumerable.Except(AllLightsInInterior)); } internal static void CollectAllUnpredictableLights() { AllUnpredictableLights.Clear(); Light item = default(Light); if (((Component)StartOfRound.Instance.spectateCamera).TryGetComponent<Light>(ref item)) { AllUnpredictableLights.Add(item); } AllUnpredictableLights.UnionWith(((Component)StartOfRound.Instance.mapScreen.mapCamera).GetComponentsInChildren<Light>()); GameObject val = GameObject.Find("ImpMap"); if ((Object)(object)val != (Object)null) { AllUnpredictableLights.UnionWith(val.GetComponentsInChildren<Light>()); } UpdateAllUnpredictableLights(); } internal static void UpdateAllUnpredictableLights() { foreach (Light allUnpredictableLight in AllUnpredictableLights) { RefreshSpecificLight(allUnpredictableLight); } } internal static void RefreshSpecificLight(Light light) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)light == (Object)null || !((Behaviour)light).isActiveAndEnabled) { AllLightsOutside.Remove(light); AllLightsInInterior.Remove(light); } else if (DungeonCullingInfo.PointIsInAnyInterior(((Component)light).transform.position)) { AllLightsOutside.Remove(light); AllLightsInInterior.Add(light); } else { AllLightsInInterior.Remove(light); AllLightsOutside.Add(light); } } internal static void CollectAllTrackedObjects() { AllLightsOutside.Clear(); AllLightsInInterior.Clear(); AllGrabbableObjectContentsOutside.Clear(); AllGrabbableObjectContentsInInterior.Clear(); GrabbableObjectToContents.Clear(); ItemsHeldByEnemies.Clear(); CollectAllLightsInWorld(); CollectAllUnpredictableLights(); PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; for (int i = 0; i < allPlayerScripts.Length; i++) { OnPlayerTeleported(allPlayerScripts[i]); } GrabbableObject[] array = Object.FindObjectsByType<GrabbableObject>((FindObjectsInactive)1, (FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { MarkGrabbableObjectDirty(array[i]); } CullingMethod.Instance?.OnDynamicLightsCollected(); } } public sealed class GrabbableObjectContents : IEquatable<GrabbableObjectContents> { public static readonly Vector3 Vector3NaN = new Vector3(float.NaN, float.NaN, float.NaN); public readonly GrabbableObject item; public Renderer[] renderers; public Light[] lights; public Vector3[] boundingVertices; public Bounds bounds; public EnemyAI heldByEnemy; public GrabbableObjectContents(GrabbableObject item) { this.item = item; renderers = Array.Empty<Renderer>(); lights = Array.Empty<Light>(); boundingVertices = Array.Empty<Vector3>(); base..ctor(); } public void CollectContents() { renderers = ((Component)item).GetComponentsInChildren<Renderer>(); lights = ((Component)item).GetComponentsInChi
CullFactoryBurstPlugin.dll
Decompiled 4 days agousing System; using System.CodeDom.Compiler; using System.ComponentModel; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using CullFactoryBurst; using Unity.Burst; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using Unity.Mathematics; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.NormalizePlane_00000004$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.ExtractPlanes_00000005$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.TestPlanesAABB_00000006$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.ComputeBoundsHeightInterval_0000000B$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.AppendEdge_0000000C$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.ComputeCandidatesOnBoundsEdges_0000000D$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.ApplyFaceConfiguration_0000000E$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.ComputeCandidatesOnBoundsFaces_0000000F$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.EdgeHasPointInsideCone_00000010$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.CandidatesHavePointInsideCone_00000011$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.ConeIntersectsBounds_00000012$BurstDirectCall))] [assembly: StaticTypeReinit(typeof(CullFactoryBurst.IsRunningBurstLibrary_00000016$BurstDirectCall))] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [CompilerGenerated] [EditorBrowsable(EditorBrowsableState.Never)] [GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)] internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { private struct MonoScriptData { public byte[] FilePathsData; public byte[] TypesData; public int TotalTypes; public int TotalFiles; public bool IsEditorOnly; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static MonoScriptData Get() { MonoScriptData result = default(MonoScriptData); result.FilePathsData = new byte[98] { 0, 0, 0, 5, 0, 0, 0, 42, 92, 65, 115, 115, 101, 116, 115, 92, 67, 117, 108, 108, 70, 97, 99, 116, 111, 114, 121, 66, 117, 114, 115, 116, 80, 108, 117, 103, 105, 110, 92, 71, 101, 111, 109, 101, 116, 114, 121, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 40, 92, 65, 115, 115, 101, 116, 115, 92, 67, 117, 108, 108, 70, 97, 99, 116, 111, 114, 121, 66, 117, 114, 115, 116, 80, 108, 117, 103, 105, 110, 92, 80, 108, 117, 103, 105, 110, 46, 99, 115 }; result.TypesData = new byte[220] { 0, 0, 0, 0, 25, 67, 117, 108, 108, 70, 97, 99, 116, 111, 114, 121, 66, 117, 114, 115, 116, 124, 71, 101, 111, 109, 101, 116, 114, 121, 0, 0, 0, 0, 30, 67, 117, 108, 108, 70, 97, 99, 116, 111, 114, 121, 66, 117, 114, 115, 116, 46, 71, 101, 111, 109, 101, 116, 114, 121, 124, 67, 111, 110, 101, 0, 0, 0, 0, 37, 67, 117, 108, 108, 70, 97, 99, 116, 111, 114, 121, 66, 117, 114, 115, 116, 46, 71, 101, 111, 109, 101, 116, 114, 121, 124, 69, 100, 103, 101, 73, 110, 100, 105, 99, 101, 115, 0, 0, 0, 0, 38, 67, 117, 108, 108, 70, 97, 99, 116, 111, 114, 121, 66, 117, 114, 115, 116, 46, 71, 101, 111, 109, 101, 116, 114, 121, 124, 70, 97, 99, 101, 73, 110, 100, 101, 120, 83, 101, 116, 0, 0, 0, 0, 37, 67, 117, 108, 108, 70, 97, 99, 116, 111, 114, 121, 66, 117, 114, 115, 116, 46, 71, 101, 111, 109, 101, 116, 114, 121, 124, 70, 97, 99, 101, 73, 110, 100, 105, 99, 101, 115, 0, 0, 0, 0, 23, 67, 117, 108, 108, 70, 97, 99, 116, 111, 114, 121, 66, 117, 114, 115, 116, 124, 80, 108, 117, 103, 105, 110 }; result.TotalFiles = 2; result.TotalTypes = 6; result.IsEditorOnly = false; return result; } } namespace CullFactoryBurst; [BurstCompile] public static class Geometry { private struct Cone { internal Vector3 origin; internal Vector3 direction; internal float length; internal float cosAngle; internal Cone(Vector3 origin, Vector3 direction, float length, float angle) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) this.origin = origin; this.direction = direction; this.length = length; cosAngle = math.cos(math.radians(angle / 2f)); } } private struct EdgeIndices { internal int a; internal int b; internal EdgeIndices(int a, int b) { this.a = a; this.b = b; } } private struct FaceIndexSet { internal int a; internal int b; internal int c; internal int d; internal FaceIndexSet(int a, int b, int c, int d) { this.a = a; this.b = b; this.c = c; this.d = d; } } private struct FaceIndices { internal FaceIndexSet vertices; internal FaceIndexSet edges; internal FaceIndices(FaceIndexSet vertices, FaceIndexSet edges) { this.vertices = vertices; this.edges = edges; } } public delegate void NormalizePlane_00000004$PostfixBurstDelegate(in float4 plane, out float4 result); internal static class NormalizePlane_00000004$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(NormalizePlane_00000004$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static NormalizePlane_00000004$BurstDirectCall() { Constructor(); } public unsafe static void Invoke(in float4 plane, out float4 result) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { ((delegate* unmanaged[Cdecl]<ref float4, ref float4, void>)functionPointer)(ref plane, ref result); return; } } NormalizePlane$BurstManaged(in plane, out result); } } public unsafe delegate void ExtractPlanes_00000005$PostfixBurstDelegate(in Matrix4x4 matrix, Plane* planes); internal static class ExtractPlanes_00000005$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(ExtractPlanes_00000005$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static ExtractPlanes_00000005$BurstDirectCall() { Constructor(); } public unsafe static void Invoke(in Matrix4x4 matrix, Plane* planes) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { ((delegate* unmanaged[Cdecl]<ref Matrix4x4, Plane*, void>)functionPointer)(ref matrix, planes); return; } } ExtractPlanes$BurstManaged(in matrix, planes); } } public unsafe delegate bool TestPlanesAABB_00000006$PostfixBurstDelegate(Plane* planes, int planeCount, in Bounds bounds); internal static class TestPlanesAABB_00000006$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(TestPlanesAABB_00000006$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static TestPlanesAABB_00000006$BurstDirectCall() { Constructor(); } public unsafe static bool Invoke(Plane* planes, int planeCount, in Bounds bounds) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { return ((delegate* unmanaged[Cdecl]<Plane*, int, ref Bounds, bool>)functionPointer)(planes, planeCount, ref bounds); } } return TestPlanesAABB$BurstManaged(planes, planeCount, in bounds); } } public delegate void ComputeBoundsHeightInterval_0000000B$PostfixBurstDelegate(in Bounds bounds, in Cone cone, out float minHeight, out float maxHeight); internal static class ComputeBoundsHeightInterval_0000000B$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(ComputeBoundsHeightInterval_0000000B$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static ComputeBoundsHeightInterval_0000000B$BurstDirectCall() { Constructor(); } public unsafe static void Invoke(in Bounds bounds, in Cone cone, out float minHeight, out float maxHeight) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { ((delegate* unmanaged[Cdecl]<ref Bounds, ref Cone, ref float, ref float, void>)functionPointer)(ref bounds, ref cone, ref minHeight, ref maxHeight); return; } } ComputeBoundsHeightInterval$BurstManaged(in bounds, in cone, out minHeight, out maxHeight); } } public unsafe delegate void AppendEdge_0000000C$PostfixBurstDelegate(EdgeIndices* edges, ref int edgeCount, in EdgeIndices edge); internal static class AppendEdge_0000000C$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(AppendEdge_0000000C$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static AppendEdge_0000000C$BurstDirectCall() { Constructor(); } public unsafe static void Invoke(EdgeIndices* edges, ref int edgeCount, in EdgeIndices edge) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { ((delegate* unmanaged[Cdecl]<EdgeIndices*, ref int, ref EdgeIndices, void>)functionPointer)(edges, ref edgeCount, ref edge); return; } } AppendEdge$BurstManaged(edges, ref edgeCount, in edge); } } public unsafe delegate void ComputeCandidatesOnBoundsEdges_0000000D$PostfixBurstDelegate(in Cone cone, float3* vertices, float* projectionsMin, float* projectionsMax, EdgeIndices* candidates, ref int candidateCount); internal static class ComputeCandidatesOnBoundsEdges_0000000D$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(ComputeCandidatesOnBoundsEdges_0000000D$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static ComputeCandidatesOnBoundsEdges_0000000D$BurstDirectCall() { Constructor(); } public unsafe static void Invoke(in Cone cone, float3* vertices, float* projectionsMin, float* projectionsMax, EdgeIndices* candidates, ref int candidateCount) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { ((delegate* unmanaged[Cdecl]<ref Cone, float3*, float*, float*, EdgeIndices*, ref int, void>)functionPointer)(ref cone, vertices, projectionsMin, projectionsMax, candidates, ref candidateCount); return; } } ComputeCandidatesOnBoundsEdges$BurstManaged(in cone, vertices, projectionsMin, projectionsMax, candidates, ref candidateCount); } } public unsafe delegate void ApplyFaceConfiguration_0000000E$PostfixBurstDelegate(in FaceIndices face, float* projections, int baseIndex, EdgeIndices* candidates, ref int candidateCount); internal static class ApplyFaceConfiguration_0000000E$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(ApplyFaceConfiguration_0000000E$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static ApplyFaceConfiguration_0000000E$BurstDirectCall() { Constructor(); } public unsafe static void Invoke(in FaceIndices face, float* projections, int baseIndex, EdgeIndices* candidates, ref int candidateCount) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { ((delegate* unmanaged[Cdecl]<ref FaceIndices, float*, int, EdgeIndices*, ref int, void>)functionPointer)(ref face, projections, baseIndex, candidates, ref candidateCount); return; } } ApplyFaceConfiguration$BurstManaged(in face, projections, baseIndex, candidates, ref candidateCount); } } public unsafe delegate void ComputeCandidatesOnBoundsFaces_0000000F$PostfixBurstDelegate(float3* vertices, float* projectionsMin, float* projectionsMax, EdgeIndices* candidates, ref int candidateCount); internal static class ComputeCandidatesOnBoundsFaces_0000000F$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(ComputeCandidatesOnBoundsFaces_0000000F$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static ComputeCandidatesOnBoundsFaces_0000000F$BurstDirectCall() { Constructor(); } public unsafe static void Invoke(float3* vertices, float* projectionsMin, float* projectionsMax, EdgeIndices* candidates, ref int candidateCount) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { ((delegate* unmanaged[Cdecl]<float3*, float*, float*, EdgeIndices*, ref int, void>)functionPointer)(vertices, projectionsMin, projectionsMax, candidates, ref candidateCount); return; } } ComputeCandidatesOnBoundsFaces$BurstManaged(vertices, projectionsMin, projectionsMax, candidates, ref candidateCount); } } public delegate bool EdgeHasPointInsideCone_00000010$PostfixBurstDelegate(in float3 pointA, in float3 pointB, in Cone cone); internal static class EdgeHasPointInsideCone_00000010$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(EdgeHasPointInsideCone_00000010$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static EdgeHasPointInsideCone_00000010$BurstDirectCall() { Constructor(); } public unsafe static bool Invoke(in float3 pointA, in float3 pointB, in Cone cone) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { return ((delegate* unmanaged[Cdecl]<ref float3, ref float3, ref Cone, bool>)functionPointer)(ref pointA, ref pointB, ref cone); } } return EdgeHasPointInsideCone$BurstManaged(in pointA, in pointB, in cone); } } public unsafe delegate bool CandidatesHavePointInsideCone_00000011$PostfixBurstDelegate(in Cone cone, float3* vertices, EdgeIndices* candidates, int candidateCount); internal static class CandidatesHavePointInsideCone_00000011$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(CandidatesHavePointInsideCone_00000011$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static CandidatesHavePointInsideCone_00000011$BurstDirectCall() { Constructor(); } public unsafe static bool Invoke(in Cone cone, float3* vertices, EdgeIndices* candidates, int candidateCount) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { return ((delegate* unmanaged[Cdecl]<ref Cone, float3*, EdgeIndices*, int, bool>)functionPointer)(ref cone, vertices, candidates, candidateCount); } } return CandidatesHavePointInsideCone$BurstManaged(in cone, vertices, candidates, candidateCount); } } public delegate bool ConeIntersectsBounds_00000012$PostfixBurstDelegate(in Cone cone, in Bounds bounds); internal static class ConeIntersectsBounds_00000012$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(ConeIntersectsBounds_00000012$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static ConeIntersectsBounds_00000012$BurstDirectCall() { Constructor(); } public unsafe static bool Invoke(in Cone cone, in Bounds bounds) { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { return ((delegate* unmanaged[Cdecl]<ref Cone, ref Bounds, bool>)functionPointer)(ref cone, ref bounds); } } return ConeIntersectsBounds$BurstManaged(in cone, in bounds); } } private static bool WarnedCallWasNotBurstCompiled = false; private static readonly EdgeIndices[] edges = new EdgeIndices[12] { new EdgeIndices(0, 1), new EdgeIndices(1, 3), new EdgeIndices(2, 3), new EdgeIndices(0, 2), new EdgeIndices(4, 5), new EdgeIndices(5, 7), new EdgeIndices(6, 7), new EdgeIndices(4, 6), new EdgeIndices(0, 4), new EdgeIndices(1, 5), new EdgeIndices(3, 7), new EdgeIndices(2, 6) }; private const int CornerVertexCount = 8; private const int MaxVertexCount = 32; private const int ClipVerticesMinBaseIndex = 8; private const int ClipVerticesMaxBaseIndex = 20; private const int BoxEdgeCount = 12; private const int MaxEdgeCandidateCount = 496; private static readonly FaceIndices[] faces = new FaceIndices[6] { new FaceIndices(new FaceIndexSet(0, 4, 6, 2), new FaceIndexSet(8, 7, 11, 3)), new FaceIndices(new FaceIndexSet(1, 3, 7, 5), new FaceIndexSet(1, 10, 5, 9)), new FaceIndices(new FaceIndexSet(0, 1, 5, 4), new FaceIndexSet(0, 9, 4, 8)), new FaceIndices(new FaceIndexSet(2, 6, 7, 3), new FaceIndexSet(11, 6, 10, 2)), new FaceIndices(new FaceIndexSet(0, 2, 3, 1), new FaceIndexSet(3, 2, 1, 0)), new FaceIndices(new FaceIndexSet(4, 5, 7, 6), new FaceIndexSet(4, 5, 6, 7)) }; [BurstDiscard] public static void WarnIfNotBurstCompiled() { if (!WarnedCallWasNotBurstCompiled) { Debug.LogWarning((object)"Methods intended to be Burst-compiled in CullFactoryBurstPlugin are not using Burst."); WarnedCallWasNotBurstCompiled = true; } } [BurstCompile(/*Could not decode attribute arguments.*/)] private static void NormalizePlane(in float4 plane, out float4 result) { NormalizePlane_00000004$BurstDirectCall.Invoke(in plane, out result); } [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static void ExtractPlanes(in Matrix4x4 matrix, Plane* planes) { ExtractPlanes_00000005$BurstDirectCall.Invoke(in matrix, planes); } [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static bool TestPlanesAABB(Plane* planes, int planeCount, in Bounds bounds) { return TestPlanesAABB_00000006$BurstDirectCall.Invoke(planes, planeCount, in bounds); } public unsafe static bool TestPlanesAABB(in Plane[] planes, in Bounds bounds) { if (planes.Length == 0) { return true; } return TestPlanesAABB((Plane*)UnsafeUtility.AddressOf<Plane>(ref planes[0]), planes.Length, in bounds); } public unsafe static bool TestPlanesAABB(in Span<Plane> planes, in Bounds bounds) { if (planes.Length == 0) { return true; } return TestPlanesAABB((Plane*)UnsafeUtility.AddressOf<Plane>(ref planes[0]), planes.Length, in bounds); } public unsafe static bool TestPlanesAABB(in NativeArray<Plane> planes, in Bounds bounds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) return TestPlanesAABB((Plane*)NativeArrayUnsafeUtility.GetUnsafePtr<Plane>(planes), planes.Length, in bounds); } public unsafe static bool TestPlanesAABB(in NativeSlice<Plane> planes, in Bounds bounds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) return TestPlanesAABB((Plane*)NativeSliceUnsafeUtility.GetUnsafePtr<Plane>(planes), planes.Length, in bounds); } [BurstCompile(/*Could not decode attribute arguments.*/)] private static void ComputeBoundsHeightInterval(in Bounds bounds, in Cone cone, out float minHeight, out float maxHeight) { ComputeBoundsHeightInterval_0000000B$BurstDirectCall.Invoke(in bounds, in cone, out minHeight, out maxHeight); } [BurstCompile(/*Could not decode attribute arguments.*/)] private unsafe static void AppendEdge(EdgeIndices* edges, ref int edgeCount, in EdgeIndices edge) { AppendEdge_0000000C$BurstDirectCall.Invoke(edges, ref edgeCount, in edge); } [BurstCompile(/*Could not decode attribute arguments.*/)] private unsafe static void ComputeCandidatesOnBoundsEdges(in Cone cone, float3* vertices, float* projectionsMin, float* projectionsMax, EdgeIndices* candidates, ref int candidateCount) { ComputeCandidatesOnBoundsEdges_0000000D$BurstDirectCall.Invoke(in cone, vertices, projectionsMin, projectionsMax, candidates, ref candidateCount); } [BurstCompile(/*Could not decode attribute arguments.*/)] private unsafe static void ApplyFaceConfiguration(in FaceIndices face, float* projections, int baseIndex, EdgeIndices* candidates, ref int candidateCount) { ApplyFaceConfiguration_0000000E$BurstDirectCall.Invoke(in face, projections, baseIndex, candidates, ref candidateCount); } [BurstCompile(/*Could not decode attribute arguments.*/)] private unsafe static void ComputeCandidatesOnBoundsFaces(float3* vertices, float* projectionsMin, float* projectionsMax, EdgeIndices* candidates, ref int candidateCount) { ComputeCandidatesOnBoundsFaces_0000000F$BurstDirectCall.Invoke(vertices, projectionsMin, projectionsMax, candidates, ref candidateCount); } [BurstCompile(/*Could not decode attribute arguments.*/)] private static bool EdgeHasPointInsideCone(in float3 pointA, in float3 pointB, in Cone cone) { return EdgeHasPointInsideCone_00000010$BurstDirectCall.Invoke(in pointA, in pointB, in cone); } [BurstCompile(/*Could not decode attribute arguments.*/)] private unsafe static bool CandidatesHavePointInsideCone(in Cone cone, float3* vertices, EdgeIndices* candidates, int candidateCount) { return CandidatesHavePointInsideCone_00000011$BurstDirectCall.Invoke(in cone, vertices, candidates, candidateCount); } [BurstCompile(/*Could not decode attribute arguments.*/)] private static bool ConeIntersectsBounds(in Cone cone, in Bounds bounds) { return ConeIntersectsBounds_00000012$BurstDirectCall.Invoke(in cone, in bounds); } public static bool SpotLightInfluencesBounds(in Light light, in Bounds bounds) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)light).transform; Cone cone = new Cone(transform.position, transform.forward, light.range, light.spotAngle); return ConeIntersectsBounds(in cone, in bounds); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public static void NormalizePlane$BurstManaged(in float4 plane, out float4 result) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) float4 val = plane; float4 val2 = plane; result = val / math.length(((float4)(ref val2)).xyz); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static void ExtractPlanes$BurstManaged(in Matrix4x4 matrix, Plane* planes) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 val = matrix; Vector4 row = ((Matrix4x4)(ref val)).GetRow(3); val = matrix; float4 plane = float4.op_Implicit(row + ((Matrix4x4)(ref val)).GetRow(0)); NormalizePlane(in plane, out *(float4*)planes); val = matrix; plane = float4.op_Implicit(row - ((Matrix4x4)(ref val)).GetRow(0)); NormalizePlane(in plane, out *(float4*)((byte*)planes + Unsafe.SizeOf<float4>())); val = matrix; plane = float4.op_Implicit(row - ((Matrix4x4)(ref val)).GetRow(1)); NormalizePlane(in plane, out *(float4*)((byte*)planes + (nint)2 * (nint)Unsafe.SizeOf<float4>())); val = matrix; plane = float4.op_Implicit(row + ((Matrix4x4)(ref val)).GetRow(1)); NormalizePlane(in plane, out *(float4*)((byte*)planes + (nint)3 * (nint)Unsafe.SizeOf<float4>())); val = matrix; plane = float4.op_Implicit(row + ((Matrix4x4)(ref val)).GetRow(2)); NormalizePlane(in plane, out *(float4*)((byte*)planes + (nint)4 * (nint)Unsafe.SizeOf<float4>())); val = matrix; plane = float4.op_Implicit(row - ((Matrix4x4)(ref val)).GetRow(2)); NormalizePlane(in plane, out *(float4*)((byte*)planes + (nint)5 * (nint)Unsafe.SizeOf<float4>())); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static bool TestPlanesAABB$BurstManaged(Plane* planes, int planeCount, in Bounds bounds) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) WarnIfNotBurstCompiled(); for (int i = 0; i < planeCount; i++) { Plane val = (Plane)((byte*)planes)[(nint)i * (nint)Unsafe.SizeOf<Plane>()]; float3 val2 = float3.op_Implicit(((Plane)(ref val)).normal); Bounds val3 = bounds; float num = math.dot(val2, float3.op_Implicit(((Bounds)(ref val3)).center)); float3 val4 = math.abs(float3.op_Implicit(((Plane)(ref val)).normal)); val3 = bounds; float num2 = math.dot(val4, float3.op_Implicit(((Bounds)(ref val3)).extents)); if (num + num2 + ((Plane)(ref val)).distance <= 0f) { return false; } } return true; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public static void ComputeBoundsHeightInterval$BurstManaged(in Bounds bounds, in Cone cone, out float minHeight, out float maxHeight) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) Bounds val = bounds; float3 val2 = float3.op_Implicit(((Bounds)(ref val)).center); val = bounds; float3 val3 = float3.op_Implicit(((Bounds)(ref val)).extents); float3 val4 = float3.op_Implicit(cone.origin); float3 val5 = float3.op_Implicit(cone.direction); float num = math.dot(val5, val2 - val4); val = bounds; float num2 = ((Bounds)(ref val)).extents.x * math.abs(val5.x); val = bounds; float num3 = num2 + ((Bounds)(ref val)).extents.y * math.abs(val5.y) + val3.z * math.abs(val5.z); minHeight = num - num3; maxHeight = num + num3; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static void AppendEdge$BurstManaged(EdgeIndices* edges, ref int edgeCount, in EdgeIndices edge) { edges[edgeCount++] = edge; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static void ComputeCandidatesOnBoundsEdges$BurstManaged(in Cone cone, float3* vertices, float* projectionsMin, float* projectionsMax, EdgeIndices* candidates, ref int candidateCount) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 8; i++) { float num = math.dot(float3.op_Implicit(cone.direction), (float3)((byte*)vertices)[(nint)i * (nint)Unsafe.SizeOf<float3>()]); projectionsMin[i] = 0f - num; projectionsMax[i] = num - cone.length; } int num2 = 8; int num3 = 20; for (int num4 = 0; num4 < 12; num4++) { EdgeIndices edge = edges[num4]; float num5 = projectionsMin[edge.a]; float num6 = projectionsMin[edge.b]; int num7; if (!(num5 < 0f) || !(num6 > 0f)) { if (num5 > 0f) { num7 = ((num6 < 0f) ? 1 : 0); if (num7 != 0) { goto IL_00ab; } } else { num7 = 0; } goto IL_0104; } num7 = 1; goto IL_00ab; IL_00ab: Unsafe.Write((byte*)vertices + (nint)num2 * (nint)Unsafe.SizeOf<float3>(), (num6 * (float3)((byte*)vertices)[(nint)edge.a * (nint)Unsafe.SizeOf<float3>()] - num5 * (float3)((byte*)vertices)[(nint)edge.b * (nint)Unsafe.SizeOf<float3>()]) / (num6 - num5)); goto IL_0104; IL_0104: float num8 = projectionsMax[edge.a]; float num9 = projectionsMax[edge.b]; bool flag = (num8 < 0f && num9 > 0f) || (num8 > 0f && num9 < 0f); if (flag) { Unsafe.Write((byte*)vertices + (nint)num3 * (nint)Unsafe.SizeOf<float3>(), (num9 * (float3)((byte*)vertices)[(nint)edge.a * (nint)Unsafe.SizeOf<float3>()] - num8 * (float3)((byte*)vertices)[(nint)edge.b * (nint)Unsafe.SizeOf<float3>()]) / (num9 - num8)); } if (num7 != 0) { if (flag) { EdgeIndices edge2 = new EdgeIndices(num2, num3); AppendEdge(candidates, ref candidateCount, in edge2); } else if (num5 < 0f) { EdgeIndices edge2 = new EdgeIndices(edge.a, num2); AppendEdge(candidates, ref candidateCount, in edge2); } else { EdgeIndices edge2 = new EdgeIndices(edge.b, num2); AppendEdge(candidates, ref candidateCount, in edge2); } } else if (flag) { if (num8 < 0f) { EdgeIndices edge2 = new EdgeIndices(edge.a, num3); AppendEdge(candidates, ref candidateCount, in edge2); } else { EdgeIndices edge2 = new EdgeIndices(edge.b, num3); AppendEdge(candidates, ref candidateCount, in edge2); } } else if (num5 <= 0f && num6 <= 0f && num8 <= 0f && num9 <= 0f) { AppendEdge(candidates, ref candidateCount, in edge); } num2++; num3++; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static void ApplyFaceConfiguration$BurstManaged(in FaceIndices face, float* projections, int baseIndex, EdgeIndices* candidates, ref int candidateCount) { float num = projections[face.vertices.a]; float num2 = projections[face.vertices.b]; float num3 = projections[face.vertices.c]; float num4 = projections[face.vertices.d]; int num5 = ((!(num < 0f)) ? ((!(num > 0f)) ? 1 : 2) : 0); int num6 = ((!(num2 < 0f)) ? ((!(num2 > 0f)) ? 1 : 2) : 0); int num7 = ((!(num3 < 0f)) ? ((!(num3 > 0f)) ? 1 : 2) : 0); switch (((!(num4 < 0f)) ? ((!(num4 > 0f)) ? 1 : 2) : 0) + 3 * (num7 + 3 * (num6 + 3 * num5))) { case 2: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.c, baseIndex + face.edges.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 5: { EdgeIndices edge = new EdgeIndices(face.vertices.c, baseIndex + face.edges.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 6: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.b, baseIndex + face.edges.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 7: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.b, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 8: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.b, baseIndex + face.edges.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 11: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.c, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 14: { EdgeIndices edge = new EdgeIndices(face.vertices.c, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 15: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.c, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 16: { EdgeIndices edge = new EdgeIndices(face.vertices.b, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 17: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 18: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 19: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.b, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 20: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.b, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.c, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 21: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 22: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 23: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.c, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 24: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, baseIndex + face.edges.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 25: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 26: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, baseIndex + face.edges.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 29: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.c, face.vertices.a); AppendEdge(candidates, ref candidateCount, in edge); break; } case 32: { EdgeIndices edge = new EdgeIndices(face.vertices.a, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 33: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.c, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 34: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.c, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 35: { EdgeIndices edge = new EdgeIndices(face.vertices.a, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 38: { EdgeIndices edge = new EdgeIndices(face.vertices.a, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.d, baseIndex + face.edges.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 41: { EdgeIndices edge = new EdgeIndices(face.vertices.a, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.d, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 42: { EdgeIndices edge = new EdgeIndices(face.vertices.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.c, baseIndex + face.edges.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 43: { EdgeIndices edge = new EdgeIndices(face.vertices.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.c, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 45: { EdgeIndices edge = new EdgeIndices(face.vertices.a, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 46: { EdgeIndices edge = new EdgeIndices(face.vertices.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.b, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 47: { EdgeIndices edge = new EdgeIndices(face.vertices.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.b, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.c, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.d, face.vertices.a); AppendEdge(candidates, ref candidateCount, in edge); break; } case 48: { EdgeIndices edge = new EdgeIndices(face.vertices.a, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 49: { EdgeIndices edge = new EdgeIndices(face.vertices.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 51: { EdgeIndices edge = new EdgeIndices(face.vertices.a, baseIndex + face.edges.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 54: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, baseIndex + face.edges.a); AppendEdge(candidates, ref candidateCount, in edge); break; } case 55: { EdgeIndices edge = new EdgeIndices(face.vertices.d, baseIndex + face.edges.a); AppendEdge(candidates, ref candidateCount, in edge); break; } case 56: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.c, baseIndex + face.edges.a); AppendEdge(candidates, ref candidateCount, in edge); break; } case 57: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.a); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.a, baseIndex + face.edges.a); AppendEdge(candidates, ref candidateCount, in edge); break; } case 58: { EdgeIndices edge = new EdgeIndices(face.vertices.d, face.vertices.a); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.a, baseIndex + face.edges.a); AppendEdge(candidates, ref candidateCount, in edge); break; } case 59: { EdgeIndices edge = new EdgeIndices(face.vertices.c, baseIndex + face.edges.a); AppendEdge(candidates, ref candidateCount, in edge); break; } case 60: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.a); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.a, baseIndex + face.edges.a); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.c, baseIndex + face.edges.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 61: { EdgeIndices edge = new EdgeIndices(face.vertices.d, face.vertices.a); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.a, baseIndex + face.edges.a); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(baseIndex + face.edges.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.c, face.vertices.d); AppendEdge(candidates, ref candidateCount, in edge); break; } case 62: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.a, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 63: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 64: { EdgeIndices edge = new EdgeIndices(face.vertices.d, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 65: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.c, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 66: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.a); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 69: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, face.vertices.a); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.a, face.vertices.b); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.b, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); edge = new EdgeIndices(face.vertices.c, baseIndex + face.edges.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 72: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 73: { EdgeIndices edge = new EdgeIndices(face.vertices.d, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 74: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.c, baseIndex + face.edges.b); AppendEdge(candidates, ref candidateCount, in edge); break; } case 75: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.c, face.vertices.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 78: { EdgeIndices edge = new EdgeIndices(baseIndex + face.edges.d, baseIndex + face.edges.c); AppendEdge(candidates, ref candidateCount, in edge); break; } case 3: case 4: case 9: case 10: case 12: case 13: case 27: case 28: case 30: case 31: case 36: case 37: case 39: case 40: case 44: case 50: case 52: case 53: case 67: case 68: case 70: case 71: case 76: case 77: break; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static void ComputeCandidatesOnBoundsFaces$BurstManaged(float3* vertices, float* projectionsMin, float* projectionsMax, EdgeIndices* candidates, ref int candidateCount) { for (int i = 0; i < 6; i++) { FaceIndices face = faces[i]; ApplyFaceConfiguration(in face, projectionsMin, 8, candidates, ref candidateCount); ApplyFaceConfiguration(in face, projectionsMax, 20, candidates, ref candidateCount); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public static bool EdgeHasPointInsideCone$BurstManaged(in float3 pointA, in float3 pointB, in Cone cone) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) if (math.dot(float3.op_Implicit(cone.direction), pointA) - cone.cosAngle * math.length(pointA) > 0f) { return true; } if (math.dot(float3.op_Implicit(cone.direction), pointB) - cone.cosAngle * math.length(pointB) > 0f) { return true; } float3 val = pointB - pointA; float3 val2 = math.cross(pointA, float3.op_Implicit(cone.direction)); float3 val3 = math.cross(pointA, val); float num = math.dot(val3, val2); if (num > 0f) { float3 val4 = math.cross(pointB, float3.op_Implicit(cone.direction)); float num2 = math.dot(val3, val4); if (num2 < 0f) { float num3 = num / (num - num2); float3 val5 = pointA + num3 * val; if (math.dot(float3.op_Implicit(cone.direction), val5) - cone.cosAngle * math.length(val5) > 0f) { return true; } } } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static bool CandidatesHavePointInsideCone$BurstManaged(in Cone cone, float3* vertices, EdgeIndices* candidates, int candidateCount) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < candidateCount; i++) { EdgeIndices edgeIndices = candidates[i]; float3 pointA = (float3)((byte*)vertices)[(nint)edgeIndices.a * (nint)Unsafe.SizeOf<float3>()]; float3 pointB = (float3)((byte*)vertices)[(nint)edgeIndices.b * (nint)Unsafe.SizeOf<float3>()]; if (EdgeHasPointInsideCone(in pointA, in pointB, in cone)) { return true; } } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile(/*Could not decode attribute arguments.*/)] public unsafe static bool ConeIntersectsBounds$BurstManaged(in Cone cone, in Bounds bounds) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) WarnIfNotBurstCompiled(); ComputeBoundsHeightInterval(in bounds, in cone, out var minHeight, out var maxHeight); if (maxHeight <= 0f || minHeight >= cone.length) { return false; } Bounds val = bounds; float num = default(float); if (((Bounds)(ref val)).IntersectRay(new Ray(cone.origin, cone.direction), ref num)) { return true; } val = bounds; float3 val2 = float3.op_Implicit(((Bounds)(ref val)).min); val = bounds; float3 val3 = float3.op_Implicit(((Bounds)(ref val)).max); float3 val4 = float3.op_Implicit(cone.origin); float3* ptr = (float3*)stackalloc float3[32]; Unsafe.Write(ptr, new float3(val2.x, val2.y, val2.z) - val4); Unsafe.Write((byte*)ptr + Unsafe.SizeOf<float3>(), new float3(val3.x, val2.y, val2.z) - val4); Unsafe.Write((byte*)ptr + (nint)2 * (nint)Unsafe.SizeOf<float3>(), new float3(val2.x, val3.y, val2.z) - val4); Unsafe.Write((byte*)ptr + (nint)3 * (nint)Unsafe.SizeOf<float3>(), new float3(val3.x, val3.y, val2.z) - val4); Unsafe.Write((byte*)ptr + (nint)4 * (nint)Unsafe.SizeOf<float3>(), new float3(val2.x, val2.y, val3.z) - val4); Unsafe.Write((byte*)ptr + (nint)5 * (nint)Unsafe.SizeOf<float3>(), new float3(val3.x, val2.y, val3.z) - val4); Unsafe.Write((byte*)ptr + (nint)6 * (nint)Unsafe.SizeOf<float3>(), new float3(val2.x, val3.y, val3.z) - val4); Unsafe.Write((byte*)ptr + (nint)7 * (nint)Unsafe.SizeOf<float3>(), new float3(val3.x, val3.y, val3.z) - val4); EdgeIndices* ptr2 = stackalloc EdgeIndices[1024]; int candidateCount = 0; if (minHeight >= 0f && maxHeight <= cone.length) { for (int i = 0; i < 12; i++) { ptr2[i] = edges[i]; candidateCount++; } return CandidatesHavePointInsideCone(in cone, ptr, ptr2, candidateCount); } float* projectionsMin = stackalloc float[8]; float* projectionsMax = stackalloc float[8]; ComputeCandidatesOnBoundsEdges(in cone, ptr, projectionsMin, projectionsMax, ptr2, ref candidateCount); ComputeCandidatesOnBoundsFaces(ptr, projectionsMin, projectionsMax, ptr2, ref candidateCount); return CandidatesHavePointInsideCone(in cone, ptr, ptr2, candidateCount); } } [BurstCompile] public static class Plugin { public delegate bool IsRunningBurstLibrary_00000016$PostfixBurstDelegate(); internal static class IsRunningBurstLibrary_00000016$BurstDirectCall { private static IntPtr Pointer; private static IntPtr DeferredCompilation; [BurstDiscard] private unsafe static void GetFunctionPointerDiscard(ref IntPtr P_0) { if (Pointer == (IntPtr)0) { Pointer = (nint)BurstCompiler.GetILPPMethodFunctionPointer2(DeferredCompilation, (RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/, typeof(IsRunningBurstLibrary_00000016$PostfixBurstDelegate).TypeHandle); } P_0 = Pointer; } private static IntPtr GetFunctionPointer() { nint result = 0; GetFunctionPointerDiscard(ref result); return result; } public static void Constructor() { DeferredCompilation = BurstCompiler.CompileILPPMethod2((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/); } public static void Initialize() { } static IsRunningBurstLibrary_00000016$BurstDirectCall() { Constructor(); } public unsafe static bool Invoke() { if (BurstCompiler.IsEnabled) { IntPtr functionPointer = GetFunctionPointer(); if (functionPointer != (IntPtr)0) { return ((delegate* unmanaged[Cdecl]<bool>)functionPointer)(); } } return IsRunningBurstLibrary$BurstManaged(); } } [BurstDiscard] private static void SetValueFalseIfManaged(ref bool value) { value = false; } [BurstCompile] public static bool IsRunningBurstLibrary() { return IsRunningBurstLibrary_00000016$BurstDirectCall.Invoke(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [BurstCompile] public static bool IsRunningBurstLibrary$BurstManaged() { bool value = true; SetValueFalseIfManaged(ref value); return value; } } internal static class $BurstDirectCallInitializer { [RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)] private static void Initialize() { Geometry.NormalizePlane_00000004$BurstDirectCall.Initialize(); Geometry.ExtractPlanes_00000005$BurstDirectCall.Initialize(); Geometry.TestPlanesAABB_00000006$BurstDirectCall.Initialize(); Geometry.ComputeBoundsHeightInterval_0000000B$BurstDirectCall.Initialize(); Geometry.AppendEdge_0000000C$BurstDirectCall.Initialize(); Geometry.ComputeCandidatesOnBoundsEdges_0000000D$BurstDirectCall.Initialize(); Geometry.ApplyFaceConfiguration_0000000E$BurstDirectCall.Initialize(); Geometry.ComputeCandidatesOnBoundsFaces_0000000F$BurstDirectCall.Initialize(); Geometry.EdgeHasPointInsideCone_00000010$BurstDirectCall.Initialize(); Geometry.CandidatesHavePointInsideCone_00000011$BurstDirectCall.Initialize(); Geometry.ConeIntersectsBounds_00000012$BurstDirectCall.Initialize(); Plugin.IsRunningBurstLibrary_00000016$BurstDirectCall.Initialize(); } }