50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using System;
|
|
using Convention;
|
|
using UnityEngine;
|
|
|
|
namespace Demo.Game
|
|
{
|
|
public class TickRotation : Updatement<Vector3>
|
|
{
|
|
public static TickRotation Make()
|
|
{
|
|
return new GameObject().AddComponent<TickRotation>();
|
|
}
|
|
|
|
protected override Vector3 Lerp(Vector3 begin, Vector3 end, float t)
|
|
{
|
|
return Vector3.Lerp(begin, end, t);
|
|
}
|
|
|
|
protected override void UpdateData(Vector3 data)
|
|
{
|
|
UpdateTarget.transform.localEulerAngles = data;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 新增
|
|
/// </summary>
|
|
/// <param name="time">插值时间</param>
|
|
/// <param name="x">x</param>
|
|
/// <param name="y">y</param>
|
|
/// <param name="z">z</param>
|
|
/// <param name="curveType">可取值为30种缓动曲线</param>
|
|
[ScriptableCall(@"
|
|
<summary>
|
|
新增
|
|
</summary>
|
|
<param name=""time"">插值时间</param>
|
|
<param name=""x"">x</param>
|
|
<param name=""y"">y</param>
|
|
<param name=""z"">z</param>
|
|
<param name=""curveType"">可取值为30种缓动曲线</param>
|
|
")]
|
|
public void Add(string time, string x, string y, string z, string curveType)
|
|
{
|
|
ManualAddEntry(time,
|
|
new(float.Parse(x), float.Parse(y), float.Parse(z)),
|
|
Enum.Parse<MathExtension.EaseCurveType>(curveType));
|
|
}
|
|
}
|
|
}
|