开始转换函数输入以匹配新的解析器

This commit is contained in:
2025-10-15 01:16:16 +08:00
parent e693e8dac1
commit d81ebbece8

View File

@@ -431,13 +431,27 @@ namespace Demo
public static float OneBarTime = 1; public static float OneBarTime = 1;
/// <summary> /// <summary>
/// 从字符串解析为浮点数
/// <list type="bullet">从时间点列表<see cref="TimePoints"/>中获取</list> /// <list type="bullet">从时间点列表<see cref="TimePoints"/>中获取</list>
/// <list type="bullet">或是从上下文变量<see cref="GetCompleteScriptContext"/>中获取</list> /// <list type="bullet">或是从上下文变量<see cref="GetCompleteScriptContext"/>中获取</list>
/// <list type="bullet">或是从数据驱动对象<see cref="DDT{float}"/>的<see cref="float"/>泛型中获取</list> /// <list type="bullet">或是从数据驱动对象<see cref="DDT"/>中获取</list>
/// <list type="bullet">或是通过计算表达式值获取</list>
/// <list type="bullet">或是直接调用<see cref="float.Parse(string)"/></list> /// <list type="bullet">或是直接调用<see cref="float.Parse(string)"/></list>
/// </summary> /// </summary>
/// <param name="value"></param> /// <param name="value"></param>
/// <returns></returns> /// <returns></returns>
[ScriptableCall(@"
<summary>
从字符串解析为浮点数
从时间点列表中获取
或是从上下文变量中获取
或是从数据驱动对象中获取
或是通过计算表达式值获取
或是直接调用float.Parse(string)
</summary>
<param name=""value""></param>
<returns></returns>
")]
public float Parse(string value) public float Parse(string value)
{ {
value = value.Trim(); value = value.Trim();
@@ -900,13 +914,24 @@ namespace Demo
public ScriptableObject Parent; public ScriptableObject Parent;
/// <summary>
/// 获取根脚本对象
/// </summary>
/// <returns></returns>
[ScriptableCall(@"
<summary>
获取根脚本对象
</summary>
<returns></returns>
")]
public RootObject GetRoot() public RootObject GetRoot()
{ {
if (Parent == null) if (Parent == null)
return this as RootObject; return this as RootObject;
if (Parent is RootObject result) if (Parent is RootObject result)
return result; return result;
else return Parent.GetRoot(); else
return Parent.GetRoot();
} }
public List<ScriptableObject> Childs = new(); public List<ScriptableObject> Childs = new();