From e79117a3a698dcc23894fa29d348adc637055442 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 22 Nov 2024 19:55:16 +0900 Subject: [PATCH] RectCloth.OnDrawGizmosSelected --- .../Runtime/Components/RectCloth.cs | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/RectCloth.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/RectCloth.cs index 254a336dc..f1f5c71de 100644 --- a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/RectCloth.cs +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/RectCloth.cs @@ -26,49 +26,49 @@ namespace RotateParticle.Components } } - // public void OnDrawGizmosSelected() - // { - // if (Warps.Count == 0) - // { - // return; - // } + public void OnDrawGizmosSelected() + { + if (Warps.Count == 0) + { + return; + } - // // Gizmos.color = Color.red; - // Gizmos.color = new Color(1, 0.5f, 0); - // for (int i = 0; i < Warps.Count; ++i) - // { - // if (i + 1 == Warps.Count) - // { - // if (LoopIsClosed) - // { - // DrawWeft(Warps[i], Warps[0]); - // } - // } - // else - // { - // DrawWeft(Warps[i], Warps[i + 1]); - // } - // } - // } + // Gizmos.color = Color.red; + Gizmos.color = new Color(1, 0.5f, 0); + for (int i = 0; i < Warps.Count; ++i) + { + if (i + 1 == Warps.Count) + { + if (LoopIsClosed) + { + DrawWeft(Warps[i], Warps[0]); + } + } + else + { + DrawWeft(Warps[i], Warps[i + 1]); + } + } + } - // void DrawWeft(WarpR w0, Warp w1) - // { - // if (w0 == null || w1 == null) - // { - // return; - // } + void DrawWeft(WarpRoot w0, WarpRoot w1) + { + if (w0 == null || w1 == null) + { + return; + } - // Gizmos.DrawLine(w0.transform.position, w1.transform.position); + Gizmos.DrawLine(w0.transform.position, w1.transform.position); - // for (int i = 0; i < w0.Particles.Count && i < w1.Particles.Count; ++i) - // { - // var p0 = w0.Particles[i]; - // var p1 = w1.Particles[i]; - // if (p0 != null && p0.Transform != null && p1 != null && p1.Transform != null) - // { - // Gizmos.DrawLine(p0.Transform.position, p1.Transform.position); - // } - // } - // } + for (int i = 0; i < w0.Particles.Count && i < w1.Particles.Count; ++i) + { + var p0 = w0.Particles[i]; + var p1 = w1.Particles[i]; + if (p0.Transform != null && p1.Transform != null) + { + Gizmos.DrawLine(p0.Transform.position, p1.Transform.position); + } + } + } } } \ No newline at end of file