推进同化RScript

This commit is contained in:
2025-11-24 18:02:57 +08:00
parent fc8f48bc7e
commit 2e0d16db49
17 changed files with 400 additions and 864 deletions

View File

@@ -11,17 +11,22 @@ namespace Demo.Game
return new GameObject("", typeof(Node)).AddComponent<SplineNode>();
}
public Node MyNode;
private Node m_MyNode;
public float NodeSize = 1;
public Color NodeColor = Color.white;
public bool IsSetupNodeRotation = false;
public Vector3 NodeRotation = Vector3.zero;
public int MyNodeContent = 0;
public override IEnumerator LoadScript(string script)
public Node MyNode
{
MyNode = GetComponent<Node>();
yield return base.LoadScript(script);
get
{
if (m_MyNode == null)
m_MyNode = GetComponent<Node>();
return m_MyNode;
}
}
public void AddTo(SplineCore core)
@@ -38,9 +43,9 @@ namespace Demo.Game
/// </summary>
/// <param name="size"></param>
[Convention.RScript.Variable.Attr.Method]
public void SetNodeSize(string size)
public void SetNodeSize(float size)
{
NodeSize = Parse(size);
NodeSize = size;
}
/// <summary>
@@ -51,9 +56,9 @@ namespace Demo.Game
/// <param name="b"></param>
/// <param name="a"></param>
[Convention.RScript.Variable.Attr.Method]
public void SetNodeColor(string r, string g, string b, string a)
public void SetNodeColor(float r, float g, float b, float a)
{
NodeColor = new(Parse(r), Parse(g), Parse(b), Parse(a));
NodeColor = new(r, g, b, a);
}
/// <summary>
@@ -63,10 +68,10 @@ namespace Demo.Game
/// <param name="y"></param>
/// <param name="z"></param>
[Convention.RScript.Variable.Attr.Method]
public void SetNodeRotation(string x, string y, string z)
public void SetNodeRotation(float x, float y, float z)
{
IsSetupNodeRotation = true;
this.transform.localEulerAngles = NodeRotation = new(Parse(x), Parse(y), Parse(z));
this.transform.localEulerAngles = NodeRotation = new(x, y, z);
}
}
}