48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
using System;
|
|
using System.Collections;
|
|
using Convention;
|
|
using UnityEngine;
|
|
|
|
namespace Demo.Game
|
|
{
|
|
public abstract class BasicSplineJustFollow : Updatement<float>
|
|
{
|
|
public SplineCore MySplineCore;
|
|
|
|
protected override float Lerp(float begin, float end, float t)
|
|
{
|
|
return Mathf.Lerp(begin, end, t);
|
|
}
|
|
|
|
protected override abstract void UpdateData(float data);
|
|
|
|
public override IEnumerator UnloadScript()
|
|
{
|
|
MySplineCore = null;
|
|
yield return base.UnloadScript();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 新增
|
|
/// </summary>
|
|
/// <param name="time">插值时间</param>
|
|
/// <param name="value"></param>
|
|
/// <param name="curveType">可取值为30种缓动曲线</param>
|
|
[Convention.RScript.Variable.Attr.Method]
|
|
public void Add(float time, float value, MathExtension.EaseCurveType curveType)
|
|
{
|
|
ManualAddEntry(time, value, curveType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 绑定到样条线
|
|
/// </summary>
|
|
/// <param name="path">脚本位置</param>
|
|
[Convention.RScript.Variable.Attr.Method]
|
|
public void Load(SplineCore splineCore)
|
|
{
|
|
MySplineCore = splineCore;
|
|
}
|
|
}
|
|
}
|