
1.引入URP 2.引入InputSystem 3.引入Fungus 4.引入DoTween 5.引入CinemaMachine 6.引入BehaviorTree 7.引入BehaviorTree动作包 8.配置了渲染管线资源 🥵🥵🥵🥵🥵
33 lines
907 B
C#
33 lines
907 B
C#
using UnityEngine;
|
|
|
|
namespace BehaviorDesigner.Runtime.Tasks.Unity.Math
|
|
{
|
|
[TaskCategory("Unity/Math")]
|
|
[TaskDescription("Lerp the angle by an amount.")]
|
|
public class LerpAngle : Action
|
|
{
|
|
[Tooltip("The from value")]
|
|
public SharedFloat fromValue;
|
|
[Tooltip("The to value")]
|
|
public SharedFloat toValue;
|
|
[Tooltip("The amount to lerp")]
|
|
public SharedFloat lerpAmount;
|
|
[Tooltip("The lerp resut")]
|
|
[RequiredField]
|
|
public SharedFloat storeResult;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
storeResult.Value = Mathf.LerpAngle(fromValue.Value, toValue.Value, lerpAmount.Value);
|
|
return TaskStatus.Success;
|
|
}
|
|
|
|
public override void OnReset()
|
|
{
|
|
fromValue = 0;
|
|
toValue = 0;
|
|
lerpAmount = 0;
|
|
storeResult = 0;
|
|
}
|
|
}
|
|
} |