41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using Convention;
|
|
using Demo.Game.Attr;
|
|
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Demo.Game
|
|
{
|
|
[Scriptable]
|
|
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">缓动曲线</param>
|
|
[Convention.RScript.Variable.Attr.Method]
|
|
public void Add(float time, float x, float y, float z, MathExtension.EaseCurveType curveType)
|
|
{
|
|
ManualAddEntry(time, new(x, y, z), curveType);
|
|
}
|
|
}
|
|
}
|