完成Note预制体的创建体系

This commit is contained in:
2025-10-08 00:35:50 +08:00
parent 3429df6e49
commit ed0dc0b523
9 changed files with 235 additions and 91 deletions

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Demo.Game;
using UnityEngine;
namespace Demo.Game
@@ -14,6 +13,14 @@ namespace Demo.Game
public SplineCore MySplineCore { get; set; }
public BasicSplineRenderer MySplineRenderer { get; set; }
public float MySplineOffset = 0;
private Action Updater = null;
protected override void UpdateTicks(float currentTime, float deltaTime, TickType tickType)
{
base.UpdateTicks(currentTime, deltaTime, tickType);
Updater?.Invoke();
}
/// <summary>
/// 加载并绑定到新样条线
@@ -37,7 +44,8 @@ namespace Demo.Game
")]
public void EvaluatePosition(string value)
{
transform.position = MySplineCore.MySplineComputer.EvaluatePosition(Parse(value));
MySplineOffset = Parse(value);
Updater = () => transform.position = MySplineCore.MySplineComputer.EvaluatePosition(MySplineOffset);
}
/// <summary>
@@ -56,7 +64,9 @@ namespace Demo.Game
")]
public void LoadSplineRenderer(string path, string time)
{
transform.position = this.LoadSplineRendererTool(path).EvaluateClipToPosition(Parse(time));
MySplineRenderer = this.LoadSplineRendererTool(path);
MySplineOffset = Parse(time);
Updater =()=> transform.position = MySplineRenderer.EvaluateClipToPosition(MySplineOffset);
}
}
}