推进同化RScript
This commit is contained in:
@@ -27,37 +27,37 @@ namespace Demo.Game
|
||||
/// </summary>
|
||||
/// <param name="path">对象路径, 不存在时则立刻加载</param>
|
||||
[Convention.RScript.Variable.Attr.Method]
|
||||
public IEnumerator LoadSpline(string path)
|
||||
public void LoadSpline(string path)
|
||||
{
|
||||
yield return this.LoadSplineTool(path);
|
||||
this.LoadSplineTool(path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 必须先执行LoadSpline加载样条线
|
||||
/// </summary>
|
||||
/// <param name="value">百分比所在位置,取值范围是[0,1]</param>
|
||||
/// <param name="offset">百分比所在位置,取值范围是[0,1]</param>
|
||||
[Convention.RScript.Variable.Attr.Method]
|
||||
public void EvaluatePosition(string value)
|
||||
public void EvaluatePosition(float offset)
|
||||
{
|
||||
MySplineOffset = Parse(value);
|
||||
MySplineOffset = offset;
|
||||
Updater = () => transform.position = MySplineCore.MySplineComputer.EvaluatePosition(MySplineOffset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定到样条线渲染器上(必须已经加载),
|
||||
/// 绑定到样条线渲染器上
|
||||
/// 并设置跟随指定时间的时刻渲染器所生成的头部
|
||||
/// </summary>
|
||||
/// <param name="path">对象路径, 不存在时则立刻加载</param>
|
||||
/// <param name="splineRenderer">样条线渲染器对象</param>
|
||||
/// <param name="time">时刻</param>
|
||||
/// <param name="isFollowPosition">是否跟随位置, 默认开启</param>
|
||||
/// <param name="isFollowRotation">是否跟随旋转, 默认开启</param>
|
||||
[Convention.RScript.Variable.Attr.Method]
|
||||
public void LoadSplineRenderer(string path, string time, string isFollowPosition = "true", string isFollowRotation = "true")
|
||||
public void LoadSplineRenderer(BasicSplineRenderer splineRenderer, float time, bool isFollowPosition = true, bool isFollowRotation = true)
|
||||
{
|
||||
MySplineRenderer = this.LoadSplineRendererTool(path);
|
||||
MySplineOffset = Parse(time);
|
||||
bool bIsFollowPosition = ConvertValue<bool>(isFollowPosition);
|
||||
bool bIsFollowRotation = ConvertValue<bool>(isFollowRotation);
|
||||
MySplineRenderer = splineRenderer;
|
||||
MySplineOffset = time;
|
||||
bool bIsFollowPosition = isFollowPosition;
|
||||
bool bIsFollowRotation = isFollowRotation;
|
||||
if (bIsFollowPosition && bIsFollowRotation)
|
||||
{
|
||||
Updater = () =>
|
||||
|
||||
Reference in New Issue
Block a user