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 --- .../Decompile/NGS.MeshFusionPro/CombineSource.cs | 92 ---------------------- 1 file changed, 92 deletions(-) delete mode 100644 Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineSource.cs (limited to 'Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineSource.cs') diff --git a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineSource.cs b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineSource.cs deleted file mode 100644 index f010062..0000000 --- a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineSource.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using UnityEngine; - -namespace NGS.MeshFusionPro; - -public class CombineSource : ICombineSource, ICombineSource -{ - public Vector3 Position { get; private set; } - - public Bounds Bounds { get; private set; } - - public MeshCombineInfo CombineInfo { get; private set; } - - public RendererSettings RendererSettings { get; private set; } - - public event Action onCombined; - - public event Action onCombineError; - - public event Action onCombineFailed; - - public event Action onCombinedTyped; - - public event Action onCombineErrorTyped; - - public event Action onCombineFailedTyped; - - public CombineSource(GameObject go, int submeshIndex = 0) - : this(go.GetComponent().mesh, go.GetComponent(), submeshIndex) - { - } - - public CombineSource(Mesh mesh, MeshRenderer renderer, int submeshIndex = 0) - { - if (mesh == null) - { - throw new ArgumentException("Mesh is null"); - } - if (renderer == null) - { - throw new ArgumentException("Mesh Renderer is null"); - } - if (submeshIndex >= mesh.subMeshCount) - { - throw new ArgumentException("Submesh index is greater the submeshCount"); - } - MeshCombineInfo info = new MeshCombineInfo(mesh, renderer.localToWorldMatrix, renderer.lightmapScaleOffset, renderer.realtimeLightmapScaleOffset, submeshIndex); - RendererSettings settings = new RendererSettings(renderer, submeshIndex); - Construct(info, settings, renderer.bounds); - } - - public CombineSource(MeshCombineInfo info, RendererSettings settings) - : this(info, settings, info.mesh.bounds.Transform(info.transformMatrix)) - { - } - - public CombineSource(MeshCombineInfo info, RendererSettings settings, Bounds bounds) - { - Construct(info, settings, bounds); - } - - private void Construct(MeshCombineInfo info, RendererSettings settings, Bounds bounds) - { - CombineInfo = info; - RendererSettings = settings; - Position = info.transformMatrix.GetTranslation(); - Bounds = bounds; - } - - public void Combined(CombinedObject root, CombinedObjectPart part) - { - this.onCombined?.Invoke(root, part); - this.onCombinedTyped?.Invoke(root, part); - } - - public void CombineError(CombinedObject root, string errorMessage) - { - if (this.onCombineError == null && this.onCombinedTyped == null) - { - Debug.Log("Error during combine " + root.name + ", reason :" + errorMessage); - return; - } - this.onCombineError?.Invoke(root, errorMessage); - this.onCombineErrorTyped?.Invoke(root, errorMessage); - } - - public void CombineFailed(CombinedObject root) - { - this.onCombineFailed?.Invoke(root); - this.onCombineFailedTyped?.Invoke(root); - } -} -- cgit v1.1-26-g67d0