完成Note预制体的创建体系
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user