From fd42a868d8eb658e1f780e0c1b051e490f3652df Mon Sep 17 00:00:00 2001 From: ninemine <1371605831@qq.com> Date: Fri, 19 Dec 2025 11:17:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E7=9A=84Sp?= =?UTF-8?q?line=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Framework/[RScript] | 2 +- Assets/Scripts/MoreSpline/SplineNode.cs | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Framework/[RScript] b/Assets/Scripts/Framework/[RScript] index c4be6db..249a2f9 160000 --- a/Assets/Scripts/Framework/[RScript] +++ b/Assets/Scripts/Framework/[RScript] @@ -1 +1 @@ -Subproject commit c4be6dba7371951c1da2e17a543011351c10d6c5 +Subproject commit 249a2f9ce36add06f13ca62b20a54ca23144398d diff --git a/Assets/Scripts/MoreSpline/SplineNode.cs b/Assets/Scripts/MoreSpline/SplineNode.cs index c490dcb..4ac668b 100644 --- a/Assets/Scripts/MoreSpline/SplineNode.cs +++ b/Assets/Scripts/MoreSpline/SplineNode.cs @@ -51,6 +51,7 @@ namespace Demo.Game } private Node m_MyNode; + public bool IsSetupNodeSize = false; public float NodeSize = 1; public Color NodeColor = Color.white; public bool IsSetupNodeRotation = false; @@ -62,9 +63,18 @@ namespace Demo.Game public void AddTo(SplineCore core) { int MyNodeContent = core.NodeContent; - core.MySplineComputer.SetPointColor(MyNodeContent, NodeColor); + MyNode.transformSize = !IsSetupNodeSize; core.MySplineComputer.SetPointSize(MyNodeContent, NodeSize); - core.MySplineComputer.SetPointNormal(MyNodeContent, IsSetupNodeRotation ? NodeRotation.normalized : transform.up); + if (IsSetupNodeRotation) + { + MyNode.transformNormals = false; + core.MySplineComputer.SetPointNormal(MyNodeContent, NodeRotation.normalized); + } + else + { + core.MySplineComputer.SetPointNormal(MyNodeContent, transform.up); + } + core.MySplineComputer.SetPointColor(MyNodeContent, NodeColor); MyNode.AddConnection(core.MySplineComputer, MyNodeContent); } @@ -75,7 +85,7 @@ namespace Demo.Game [Convention.RScript.Variable.Attr.Method] public void SetNodeSize(float size) { - SetLocalScaling(size, size, size); + IsSetupNodeSize = true; NodeSize = size; } @@ -102,7 +112,7 @@ namespace Demo.Game public void SetNodeRotation(float x, float y, float z) { IsSetupNodeRotation = true; - this.transform.localEulerAngles = NodeRotation = new(x, y, z); + NodeRotation = new(x, y, z); } } }