using System; using System.Collections.Generic; using System.Runtime.InteropServices; using Cpp2IlInjected; using Unity.Jobs; using UnityEngine; namespace ClusterLOD { // Token: 0x02000C87 RID: 3207 [Token(Token = "0x2000C87")] [StructLayout(3)] public class ClusterMeshAssetCache : IDisposable { // Token: 0x17000D68 RID: 3432 // (get) Token: 0x06004D3B RID: 19771 RVA: 0x0011F3F4 File Offset: 0x0011D5F4 [Token(Token = "0x17000D68")] public NativeClusterMesh PrimitiveSrcMesh { [Token(Token = "0x6004D3B")] [Address(RVA = "0x1B313D0", Offset = "0x1B2FDD0", VA = "0x181B313D0")] get { NativeClusterMesh primitiveSrcMesh = this._primitiveSrcMesh; if (primitiveSrcMesh == 0) { NativeClusterMesh nativeClusterMesh = new NativeClusterMesh(); this._primitiveSrcMesh = nativeClusterMesh; int num = 0; OAHBIDJKENF oahbidjkenf = EOKPFJPCGMK.MBFEPPCGJCB(num); int vertexCount = oahbidjkenf.k__BackingField.vertexCount; Mesh k__BackingField = oahbidjkenf.k__BackingField; num += vertexCount; int num2 = 0; uint indexCount = k__BackingField.GetIndexCount(num2); num += (int)indexCount; num++; NativeClusterMesh primitiveSrcMesh2 = this._primitiveSrcMesh; OAHBIDJKENF oahbidjkenf2 = EOKPFJPCGMK.MBFEPPCGJCB(num); NativeClusterMesh primitiveSrcMesh3 = this._primitiveSrcMesh; Mesh k__BackingField2 = oahbidjkenf2.k__BackingField; int num3 = 0; primitiveSrcMesh3.AppendMesh(k__BackingField2, num3 != 0); num++; } return primitiveSrcMesh; } } // Token: 0x06004D3C RID: 19772 RVA: 0x0011F490 File Offset: 0x0011D690 [Token(Token = "0x6004D3C")] [Address(RVA = "0x1B30A60", Offset = "0x1B2F460", VA = "0x181B30A60", Slot = "4")] public void Dispose() { this.createMeshFromClusterJob.Dispose(); NativeClusterMesh primitiveSrcMesh = this._primitiveSrcMesh; if (primitiveSrcMesh != 0) { primitiveSrcMesh.Dispose(); this._primitiveSrcMesh = (ulong)0L; } } // Token: 0x06004D3D RID: 19773 RVA: 0x0011F4C8 File Offset: 0x0011D6C8 [Token(Token = "0x6004D3D")] [Address(RVA = "0x1B309E0", Offset = "0x1B2F3E0", VA = "0x181B309E0")] public void Clear() { CreateMeshFromClusterJob createMeshFromClusterJob = this.createMeshFromClusterJob; JobHandle k__BackingField = createMeshFromClusterJob.k__BackingField; createMeshFromClusterJob.k__BackingField = (ulong)0L; this.createQueue.Clear(); } // Token: 0x06004D3E RID: 19774 RVA: 0x0011F500 File Offset: 0x0011D700 [Token(Token = "0x6004D3E")] [Address(RVA = "0x1B30940", Offset = "0x1B2F340", VA = "0x181B30940")] public void Add(ClusterMesh.ClusterInfo cluster, Transform root) { List components = cluster.components; cluster.root = root; if (!this.createQueue.Contains(cluster)) { this.createQueue.Enqueue(cluster); } } // Token: 0x06004D3F RID: 19775 RVA: 0x0011F53C File Offset: 0x0011D73C [Token(Token = "0x6004D3F")] [Address(RVA = "0x1B30F00", Offset = "0x1B2F900", VA = "0x181B30F00")] public void Remove(ClusterMesh.ClusterInfo cluster) { if (this.createQueue.Contains(cluster)) { Queue queue = new Queue(); ClusterMesh.ClusterInfo clusterInfo = this.createQueue.Dequeue(); if (clusterInfo != cluster) { queue.Enqueue(clusterInfo); } Queue queue2 = this.createQueue; this.createQueue = queue; } CreateMeshFromClusterJob createMeshFromClusterJob = this.createMeshFromClusterJob; ClusterMesh.ClusterInfo k__BackingField = createMeshFromClusterJob.k__BackingField; JobHandle k__BackingField = createMeshFromClusterJob.k__BackingField; createMeshFromClusterJob.k__BackingField = (ulong)0L; if (this.activeClusters.Contains(cluster)) { bool flag = this.activeClusters.Remove(cluster); int numLOD0Verts = cluster.numLOD0Verts; } } // Token: 0x06004D40 RID: 19776 RVA: 0x0011F5D0 File Offset: 0x0011D7D0 [Token(Token = "0x6004D40")] [Address(RVA = "0x1B30B00", Offset = "0x1B2F500", VA = "0x181B30B00")] private ClusterMesh.ClusterInfo GetWorstActiveCluster() { int num; do { num = 0; List list = this.activeClusters; List.Enumerator enumerator; if (enumerator != 0) { } if (num != -1) { } } while (num != 0); throw new NullReferenceException(); } // Token: 0x06004D41 RID: 19777 RVA: 0x0011F600 File Offset: 0x0011D800 [Token(Token = "0x6004D41")] [Address(RVA = "0x1B30DD0", Offset = "0x1B2F7D0", VA = "0x181B30DD0")] private bool IsClusterActive(ClusterMesh.ClusterInfo cluster) { return this.activeClusters.Contains(cluster); } // Token: 0x06004D42 RID: 19778 RVA: 0x0011F620 File Offset: 0x0011D820 [Token(Token = "0x6004D42")] [Address(RVA = "0x1B30E70", Offset = "0x1B2F870", VA = "0x181B30E70")] private bool RemoveActiveCluster(ClusterMesh.ClusterInfo cluster) { bool flag = this.activeClusters.Contains(cluster); if (!flag) { return flag; } bool flag2 = this.activeClusters.Remove(cluster); throw new NullReferenceException(); } // Token: 0x06004D43 RID: 19779 RVA: 0x0011F654 File Offset: 0x0011D854 [Token(Token = "0x6004D43")] [Address(RVA = "0x1B308E0", Offset = "0x1B2F2E0", VA = "0x181B308E0")] private void AddActiveCluster(ClusterMesh.ClusterInfo cluster) { this.activeClusters.Add(cluster); int numLOD0Verts = cluster.numLOD0Verts; } // Token: 0x06004D44 RID: 19780 RVA: 0x0011F67C File Offset: 0x0011D87C [Token(Token = "0x6004D44")] [Address(RVA = "0x1B30C60", Offset = "0x1B2F660", VA = "0x181B30C60")] private void InitPrimitiveSrcMesh() { NativeClusterMesh nativeClusterMesh = new NativeClusterMesh(); this._primitiveSrcMesh = nativeClusterMesh; int num = 0; OAHBIDJKENF oahbidjkenf = EOKPFJPCGMK.MBFEPPCGJCB(num); int vertexCount = oahbidjkenf.k__BackingField.vertexCount; Mesh k__BackingField = oahbidjkenf.k__BackingField; num += vertexCount; int num2 = 0; uint indexCount = k__BackingField.GetIndexCount(num2); num += (int)indexCount; num++; NativeClusterMesh primitiveSrcMesh = this._primitiveSrcMesh; OAHBIDJKENF oahbidjkenf2 = EOKPFJPCGMK.MBFEPPCGJCB(num); NativeClusterMesh primitiveSrcMesh2 = this._primitiveSrcMesh; Mesh k__BackingField2 = oahbidjkenf2.k__BackingField; int num3 = 0; primitiveSrcMesh2.AppendMesh(k__BackingField2, num3 != 0); num++; } // Token: 0x06004D45 RID: 19781 RVA: 0x0011F708 File Offset: 0x0011D908 [Token(Token = "0x6004D45")] [Address(RVA = "0x1B30E30", Offset = "0x1B2F830", VA = "0x181B30E30")] public bool IsProcessing(ClusterMesh.ClusterInfo cluster) { ClusterMesh.ClusterInfo k__BackingField = this.createMeshFromClusterJob.k__BackingField; bool flag; return flag; } // Token: 0x06004D46 RID: 19782 RVA: 0x0011F72C File Offset: 0x0011D92C [Token(Token = "0x6004D46")] [Address(RVA = "0x1B31090", Offset = "0x1B2FA90", VA = "0x181B31090")] public bool Update() { ClusterMesh.ClusterInfo clusterInfo; ClusterMesh.ClusterInfo worstActiveCluster; do { CreateMeshFromClusterJob createMeshFromClusterJob = this.createMeshFromClusterJob; if (createMeshFromClusterJob.k__BackingField > (ulong)0L) { if (!JobHandle.ScheduleBatchedJobsAndIsCompleted(createMeshFromClusterJob.k__BackingField)) { } ClusterMesh.ClusterInfo k__BackingField = this.createMeshFromClusterJob.k__BackingField; bool flag = this.RemoveActiveCluster(k__BackingField); this.createMeshFromClusterJob.CreateMesh(); this.activeClusters.Add(k__BackingField); } clusterInfo = this.createQueue.Dequeue(); while (clusterInfo == 0) { } int num = this.numActiveVerts; int maxDynamicNearVerts = ClusterLODManager._instance.k__BackingField.maxDynamicNearVerts; if (num <= maxDynamicNearVerts) { goto IL_B2; } worstActiveCluster = this.GetWorstActiveCluster(); if (worstActiveCluster == 0) { goto IL_B2; } } while (clusterInfo.closestDist > worstActiveCluster.closestDist); bool flag2 = this.RemoveActiveCluster(worstActiveCluster); worstActiveCluster.RequestRemoveMesh(); IL_B2: CreateMeshFromClusterJob createMeshFromClusterJob2 = this.createMeshFromClusterJob; if (createMeshFromClusterJob2.k__BackingField <= (ulong)0L) { List components = clusterInfo.components; Transform root = clusterInfo.root; int num2 = 0; createMeshFromClusterJob2.Init(clusterInfo, root, num2); JobHandle.ScheduleBatchedJobs(); } throw new NullReferenceException(); } // Token: 0x06004D47 RID: 19783 RVA: 0x0011F830 File Offset: 0x0011DA30 [Token(Token = "0x6004D47")] [Address(RVA = "0x1B30AA0", Offset = "0x1B2F4A0", VA = "0x181B30AA0")] private ClusterMesh.ClusterInfo GetClusterToCreate() { return this.createQueue.Dequeue(); } // Token: 0x06004D48 RID: 19784 RVA: 0x0011F850 File Offset: 0x0011DA50 [Token(Token = "0x6004D48")] [Address(RVA = "0x1B31330", Offset = "0x1B2FD30", VA = "0x181B31330")] public ClusterMeshAssetCache() { Queue queue = new Queue(); this.createQueue = queue; CreateMeshFromClusterJob createMeshFromClusterJob = new CreateMeshFromClusterJob(); this.createMeshFromClusterJob = createMeshFromClusterJob; List list = new List(); this.activeClusters = list; base..ctor(); } // Token: 0x0400393D RID: 14653 [global::Cpp2IlInjected.FieldOffset(Offset = "0x10")] [Token(Token = "0x400393D")] private Queue createQueue; // Token: 0x0400393E RID: 14654 [global::Cpp2IlInjected.FieldOffset(Offset = "0x18")] [Token(Token = "0x400393E")] private CreateMeshFromClusterJob createMeshFromClusterJob; // Token: 0x0400393F RID: 14655 [global::Cpp2IlInjected.FieldOffset(Offset = "0x20")] [Token(Token = "0x400393F")] private readonly List activeClusters; // Token: 0x04003940 RID: 14656 [global::Cpp2IlInjected.FieldOffset(Offset = "0x28")] [Token(Token = "0x4003940")] private int numActiveVerts; // Token: 0x04003941 RID: 14657 [global::Cpp2IlInjected.FieldOffset(Offset = "0x30")] [Token(Token = "0x4003941")] private NativeClusterMesh _primitiveSrcMesh; } }