From cf58771365b5953c6eac548b172aae880d1f0acd Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sun, 19 May 2024 17:03:57 +0800 Subject: * rename --- .../NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs | 104 --------------------- 1 file changed, 104 deletions(-) delete mode 100644 Thronefall_1_57/Decompile/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs (limited to 'Thronefall_1_57/Decompile/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs') diff --git a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs deleted file mode 100644 index 3063894..0000000 --- a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Unity.Collections; -using UnityEngine; - -namespace NGS.MeshFusionPro; - -public class MeshDataNativeArraysSTD : CombinedMeshDataInternal -{ - private CombinedMesh _root; - - private NativeList _vertices; - - private NativeList _normals; - - private NativeList _tangents; - - private NativeList _partsBounds; - - private NativeList _partsBoundsLocal; - - private NativeArray _bounds; - - public NativeArray Vertices => _vertices; - - public NativeArray Normals => _normals; - - public NativeArray Tangents => _tangents; - - public NativeArray PartsBounds => _partsBounds; - - public NativeArray PartsBoundsLocal => _partsBoundsLocal; - - public NativeArray Bounds => _bounds; - - public override Bounds GetBounds() - { - return _bounds[0]; - } - - public override Bounds GetBounds(CombinedMeshPart part) - { - return _partsBounds[part.Index]; - } - - public void ApplyDataToMesh() - { - Mesh mesh = _root.Mesh; - mesh.SetVertices(Vertices); - mesh.SetNormals(Normals); - mesh.SetTangents(Tangents); - mesh.bounds = _bounds[0]; - } - - protected override void OnInitialized() - { - _root = base.Root; - _vertices = new NativeList(Allocator.Persistent); - _normals = new NativeList(Allocator.Persistent); - _tangents = new NativeList(Allocator.Persistent); - _partsBounds = new NativeList(Allocator.Persistent); - _partsBoundsLocal = new NativeList(Allocator.Persistent); - _bounds = new NativeArray(1, Allocator.Persistent); - } - - protected override void OnAddPart(CombinedMeshPart part, Mesh mesh, Matrix4x4 transform) - { - Bounds value = mesh.bounds; - Bounds value2 = value.Transform(transform); - _partsBounds.Add(in value2); - _partsBoundsLocal.Add(in value); - } - - protected override void OnRemovePart(CombinedMeshPart part) - { - _partsBounds.RemoveAt(part.Index); - _partsBoundsLocal.RemoveAt(part.Index); - } - - protected override void OnMeshUpdated() - { - Mesh mesh = _root.Mesh; - int vertexCount = mesh.vertexCount; - _vertices.ResizeUninitialized(vertexCount); - _normals.ResizeUninitialized(vertexCount); - _tangents.ResizeUninitialized(vertexCount); - using (Mesh.MeshDataArray meshDataArray = Mesh.AcquireReadOnlyMeshData(mesh)) - { - Mesh.MeshData meshData = meshDataArray[0]; - meshData.GetVertices(_vertices); - meshData.GetNormals(_normals); - meshData.GetTangents(_tangents); - } - _bounds[0] = mesh.bounds; - } - - protected override void OnDispose() - { - _vertices.Dispose(); - _normals.Dispose(); - _tangents.Dispose(); - _partsBounds.Dispose(); - _partsBoundsLocal.Dispose(); - _bounds.Dispose(); - } -} -- cgit v1.1-26-g67d0