修复已知的Spline错误
This commit is contained in:
Submodule Assets/Scripts/Framework/[RScript] updated: c4be6dba73...249a2f9ce3
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user