// Token: 0x060041D2 RID: 16850 RVA: 0x0014E7E0 File Offset: 0x0014CBE0 public void Inverse() { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); CSG.CSG csg = new CSG.CSG(); csg.Construct(this.A.GetComponent <MeshFilter>().sharedMesh, this.A.transform, 0); CSG.CSG csg2 = csg.Inverse(); Mesh sharedMesh = csg2.ToMesh(); this.Result = new GameObject("Inverse"); DefaultObject defaultObject = this.Result.AddComponent <DefaultObject>(); MeshFilter meshFilter = this.Result.AddComponent <MeshFilter>(); meshFilter.sharedMesh = sharedMesh; MeshRenderer meshRenderer = this.Result.AddComponent <MeshRenderer>(); meshRenderer.sharedMaterial = new Material(this.A.GetComponent <MeshRenderer>().sharedMaterial); if (this.DeleteOriginal) { UnityEngine.Object.DestroyImmediate(this.A); } stopwatch.Stop(); defaultObject.GenerationTimeMS = (float)stopwatch.ElapsedMilliseconds; }
public void Inverse() { var stopWatch = new Stopwatch(); stopWatch.Start(); var csgA = new CSG.CSG(); csgA.Construct(A.GetComponent<MeshFilter>().sharedMesh, A.transform, 0); var substract = csgA.Inverse(); var newMesh = substract.ToMesh(); Result = new GameObject("Inverse"); var defObj = Result.AddComponent<DefaultObject>(); var meshFilter = Result.AddComponent<MeshFilter>(); meshFilter.sharedMesh = newMesh; var renderer = Result.AddComponent<MeshRenderer>(); renderer.sharedMaterial = new Material(A.GetComponent<MeshRenderer>().sharedMaterial); if (DeleteOriginal) { Object.DestroyImmediate(A); } stopWatch.Stop(); defObj.GenerationTimeMS = stopWatch.ElapsedMilliseconds; }
public void Inverse() { var stopWatch = new Stopwatch(); stopWatch.Start(); var csgA = new CSG.CSG(); csgA.Construct(A.GetComponent <MeshFilter>().sharedMesh, A.transform, 0); var substract = csgA.Inverse(); var newMesh = substract.ToMesh(); Result = new GameObject("Inverse"); var defObj = Result.AddComponent <DefaultObject>(); var meshFilter = Result.AddComponent <MeshFilter>(); meshFilter.sharedMesh = newMesh; var renderer = Result.AddComponent <MeshRenderer>(); renderer.sharedMaterial = new Material(A.GetComponent <MeshRenderer>().sharedMaterial); if (DeleteOriginal) { Object.DestroyImmediate(A); } stopWatch.Stop(); defObj.GenerationTimeMS = stopWatch.ElapsedMilliseconds; }
public void Test() { var csg = new CSG.CSG(); csg.Construct(A.GetComponent<MeshFilter>().sharedMesh, A.transform, 0); var newMesh = csg.Test().ToMesh(); Result = new GameObject("Test"); Result.AddComponent<DefaultObject>(); var meshFilter = Result.AddComponent<MeshFilter>(); meshFilter.sharedMesh = newMesh; var renderer = Result.AddComponent<MeshRenderer>(); renderer.sharedMaterials = new Material[] { A.GetComponent<MeshRenderer>().sharedMaterial, B.GetComponent<MeshRenderer>().sharedMaterial }; }
public void Test() { var csg = new CSG.CSG(); csg.Construct(A.GetComponent <MeshFilter>().sharedMesh, A.transform, 0); var newMesh = csg.Test().ToMesh(); Result = new GameObject("Test"); Result.AddComponent <DefaultObject>(); var meshFilter = Result.AddComponent <MeshFilter>(); meshFilter.sharedMesh = newMesh; var renderer = Result.AddComponent <MeshRenderer>(); renderer.sharedMaterials = new Material[] { A.GetComponent <MeshRenderer>().sharedMaterial, B.GetComponent <MeshRenderer>().sharedMaterial }; }
// Token: 0x060041D1 RID: 16849 RVA: 0x0014E730 File Offset: 0x0014CB30 public void Test() { CSG.CSG csg = new CSG.CSG(); csg.Construct(this.A.GetComponent <MeshFilter>().sharedMesh, this.A.transform, 0); Mesh sharedMesh = csg.Test().ToMesh(); this.Result = new GameObject("Test"); this.Result.AddComponent <DefaultObject>(); MeshFilter meshFilter = this.Result.AddComponent <MeshFilter>(); meshFilter.sharedMesh = sharedMesh; MeshRenderer meshRenderer = this.Result.AddComponent <MeshRenderer>(); meshRenderer.sharedMaterials = new Material[] { this.A.GetComponent <MeshRenderer>().sharedMaterial, this.B.GetComponent <MeshRenderer>().sharedMaterial }; }